Building an Electron desktop pet that feels native is harder than it looks. It has to float above every other window, respond to input anywhere on screen, and do it all without hogging resources. Here is how Luna pulls it off.
Transparent, click-through overlays
Luna creates a frameless, transparent, always-on-top window for each of your displays. By default these windows are click-through — using Electron's setIgnoreMouseEvents — so your clicks pass straight through Luna to whatever is underneath. The moment your cursor hovers over her, her doghouse, or a menu, the window dynamically enables mouse capture so you can interact. This dance is what lets her live on your desktop without ever blocking your work.
Global input reactivity
To react to your cursor and typing anywhere on screen — even when Luna's window is not focused — she uses a native input hook in the Electron main process. This reads mouse coordinates and keystroke timing at the OS level.
Privacy is engineered in from the start: only the timing of keypresses is used, to calculate typing speed. The actual keys are never read, logged, or transmitted. Everything is processed in memory and discarded frame by frame.
Multi-monitor state synchronization
Because Luna spawns one overlay per display, her state must stay consistent everywhere. She keeps gameplay state synchronized in real time across every window using inter-process communication, so she can wander from one monitor to another without losing her mood, hunger, or accessories.
Why Electron was the right choice
Electron gives Luna a single codebase that runs natively on macOS, Windows, and Linux, with direct access to the transparent-window and global-hook APIs she depends on. Combined with a custom 60 FPS Canvas renderer, the result is a cross-platform desktop pet that feels bespoke on every operating system.
Curious to see it in action? Download Luna free and watch the engineering come to life.