Goals, in priority order
1
Lowest possible input lag
The headline feature. Every design choice defers to it.
2
Cross-platform
macOS ⇄ Windows (Linux best-effort).
3
Secure by default
Authenticated encryption on every channel.
4
Open source & self-hostable
No accounts, no cloud, LAN-only.
5
Feature-complete vs. paid tools
Clipboard + file transfer + seamless edge switching.
The big picture
Why two channels?
Input and bulk data have opposite requirements:
Mixing them would force the fast path to wait for retransmits of the slow path.
Keeping them separate is the single most important latency decision — see
Decision #1.
Crate layout
protocol is deliberately tiny and platform-agnostic so it can be unit-tested
anywhere and reused (e.g. a future mobile client). app holds everything that
touches the OS or the network.
Module map (crates/app/src)
Non-native modules build and test with
--no-default-features, which is what CI
uses for fast, permissionless unit tests.
Feature flags
The layering keeps the testable core (transport, protocol, crypto, config,
edge, cursor, file framing) free of any display or OS-permission dependency —
that’s why 23 unit tests run headlessly in CI.
How a keypress reaches the other machine
1
Capture & swallow
capture.rs (rdev grab) sees the key. If control is on the client, it maps
the native key to a portable Key, forwards it, and swallows it locally.2
Coalesce & seal
run.rs::run_server_input coalesces the tick’s events into one
InputMsg::Events, and transport.rs seals + sends it over UDP.3
Decrypt & de-dup
On the client,
transport.rs decrypts, drops stragglers by sequence number,
and hands the batch to run.rs::connect.4
Inject & track
emit.rs injects each event with enigo. cursor.rs integrates mouse deltas;
if the cursor crosses back over the border edge it sends InputMsg::Leave.Control handoff (the “KVM” part)
Two ways control moves from server to client:- Automatic edge switch:
edge.rsdetects the server cursor hitting a bordered screen edge (from the monitor-manager layout) →Control.active = trueand the entry position is recorded. - F12 hotkey: manual toggle, always available as a fallback.
cursor.rs detects the cursor crossing back
and sends Leave; the server clears active. See Decision #7.
Next
Wire protocol
The exact message types on each channel.
Latency
Where the microseconds actually go.