Cursorly – Ultra-Precise Mobile Mouse Control
An open-source, end-to-end mobile-to-PC touchpad and mouse control system built with a Python + FastAPI + Win32 SendInput host engine and a Kotlin + Jetpack Compose Android client.
Contribution: Designed the Python signal-processing engine (One Euro 2D filter, dynamic velocity ballistics, and fractional sub-pixel accumulation).

Problem & Audience
Problem: Mobile remote-mouse tools often suffer from capacitive touch jitter, lost sub-pixel motion during integer OS cursor ticks, and fragile single-transport setups.
Target Audience: Developers, presenters, and desktop users who want a responsive smartphone trackpad over Wi-Fi, USB ADB, Bluetooth, or a zero-install browser client.
Role: Sole Author & Systems Developer
Outcome & Personal Contribution
Implemented a multi-transport input pipeline combining a 2D One Euro adaptive filter, velocity ballistics, fractional SubpixelAccumulator, and native Win32 SendInput dispatch.
- Designed the Python signal-processing engine (One Euro 2D filter, dynamic velocity ballistics, and fractional sub-pixel accumulation).
- Built the Kotlin + Jetpack Compose Android client and zero-install HTML5 web trackpad client served by FastAPI.
- Implemented multi-transport support across WebSocket (TCP_NODELAY), ADB kernel forwarding, Bluetooth RFCOMM, and standalone BLE HID mouse.
Architecture & Data Flow
Capacitive touch deltas and multi-finger gestures flow from Android or browser clients over compact 18-byte packets into a One Euro adaptive filter and sub-pixel accumulator driving Win32 SendInput.
Captures raw touch deltas plus 200 ms / 8 dp tap-drag state disambiguation, 2-finger scroll/pinch, and 3-finger desktop switching.
- 1. Touch Input (Android / Browser): Captures raw touch deltas plus 200 ms / 8 dp tap-drag state disambiguation, 2-finger scroll/pinch, and 3-finger desktop switching.
[200 ms / 8 dp gesture state machine] - 2. Signal Filtering (1€ Filter + Subpixel): Adaptive One Euro cutoff suppresses low-speed capacitive jitter while preserving fast flicks; SubpixelAccumulator preserves fractional pixels.
[1€ adaptive filter + sub-pixel carry] - 3. Transport Layer (WS · ADB · RFCOMM · HID): Streams binary !BBffd packets (18 bytes) via WebSocket (TCP_NODELAY), ADB tunnel, Bluetooth RFCOMM, or standalone BLE HID.
[18-byte !BBffd binary packet] - 4. Desktop Output (Win32 SendInput): Injects relative integer cursor motion into Windows via SendInput with 1 ms timer resolution and UDP/mDNS host discovery.
[Win32 SendInput + 1 ms timer]
Engineering Decisions & Trade-Offs
One Euro Adaptive Filter + Fractional SubpixelAccumulator
Decision: Paired a speed-adaptive One Euro low-pass filter with residual fractional delta accumulation before casting to integer Win32 SendInput ticks.
Trade-off: Adds minimal stateful per-axis filtering overhead in Python, preventing both stationary tremor and slow-drag dead zones.
Multi-Transport Adapter Architecture
Decision: Separated transport adapters (WebSocket, ADB, RFCOMM, BLE HID, Browser Trackpad) from the core cursor engine.
Trade-off: Requires maintaining consistent packet framing across adapters, in exchange for working across locked-down Wi-Fi networks, USB cables, or zero-install browsers.
Testing & Verification Evidence
- Verified zero-install browser trackpad UI (cursorly/adapters/web_server.py) with sensitivity, orientation, sniper mode, and mouse button controls.
- Unit-tested One Euro 2D filter smoothing, cutoff adaptation, and SubpixelAccumulator residual preservation in the portfolio test suite.
Known Limitations & Scope
- Host cursor injection targets Windows Win32 SendInput (with ADB Linux kernel streaming for direct setups); the portfolio Lab simulates the filter and transport behavior inside the browser sandbox.
Captured Application Interfaces
