Use your Windows laptop keyboard and mouse to control your Android phone — like Samsung Multi Control, but for any Android device.
Press a hotkey to toggle: your keyboard types on the phone, your mouse moves the phone cursor. Press it again to switch back.
Windows Laptop Android Phone
+----------------+ WiFi/USB +----------------+
| Python App | ------------> | UHID Server |
| - Captures | ADB + TCP | - Virtual Mouse|
| keyboard & | | - Virtual |
| mouse input | | Keyboard |
| - Hotkey toggle| | - /dev/uhid |
+----------------+ +----------------+
- Windows 10/11 laptop
- Android 10+ phone
- Python 3.11+
- ADB (Android Debug Bridge) — comes with Android SDK Platform Tools
- Zig (for building the Android binary) —
pip install ziglangor download
cd deskflow
python -m venv .venv
source .venv/Scripts/activate # Windows Git Bash
pip install -e ".[dev]"
pip install pywin32 ziglangBuild the Android binary (cross-compiles C to ARM64 using Zig):
cd android
bash build.sh # outputs: android/uhid_server (aarch64, statically linked)
cd ..Note: The build targets
aarch64-linux-muslfor static linking. This works on all ARM64 Android 10+ devices. If your phone uses a different architecture, modify the-targetflag inbuild.sh.
Step 1: Enable Developer Options
- Go to Settings > About phone
- Tap "Build number" 7 times until it says "You are now a developer"
Step 2: Enable Wireless Debugging
- Go to Settings > System > Developer Options
- Turn on "Wireless debugging"
- Tap into "Wireless debugging" to see the IP & port
Step 3: Pair (one-time)
- On your phone, tap "Pair device with pairing code"
- Note the pairing address:port and 6-digit code
- On your laptop terminal:
adb pair <ip>:<pairing-port> # Enter the 6-digit code when prompted
- You should see:
Successfully paired
Step 4: Connect
- On your phone's Wireless Debugging screen, note the IP & port at the top (NOT the pairing port)
- On your laptop:
adb connect <ip>:<port>
- Verify:
adb devices # Should show your device as "device"
Troubleshooting WiFi:
- Phone and laptop must be on the same WiFi network
- Some corporate/public networks block ADB — use a different network or USB
- If
adb pairfails with "protocol fault", runadb kill-serverand retry- The pairing code expires quickly — get a fresh one if it fails
- The wireless debugging port changes each time you toggle it
- Plug your phone into your laptop via USB
- On your phone, tap "Allow USB debugging" when prompted
- Verify:
adb devices
This is the simplest option and has the lowest latency.
If your WiFi blocks ADB:
- Turn on your phone's mobile hotspot
- Connect your laptop to the hotspot
- Follow the WiFi steps above (pair + connect)
1. Make sure ADB is connected (see above)
2. Start the app:
cd deskflow
source .venv/Scripts/activate
python -m deskflow.main3. Connect: Right-click the tray icon (bottom-right of taskbar, may be in overflow) > Connect
4. Toggle input: Press Ctrl + Alt + K
- Input goes to your phone (keyboard + mouse)
- Your PC screen gets a transparent overlay to block accidental clicks
5. Toggle back: Press Ctrl + Alt + K again
- Input returns to your laptop
6. Quit: Right-click tray icon > Exit (or Ctrl+C in terminal)
Config file: ~/.deskflow/config.json
{
"phone_ip": "192.168.0.101",
"adb_port": 37745,
"hotkey_toggle": "ctrl+alt+k",
"mouse_sensitivity": 1.0,
"scroll_sensitivity": 1.0
}| Setting | Description |
|---|---|
phone_ip |
Your phone's IP address |
adb_port |
Wireless debugging port (or 5555 for USB) |
hotkey_toggle |
Key combo to toggle input (default: ctrl+alt+k) |
mouse_sensitivity |
Mouse speed multiplier (default: 1.0) |
scroll_sensitivity |
Scroll speed multiplier (default: 1.0) |
- Keyboard goes to both PC and phone — keys aren't suppressed on the PC side yet
- Win key, Alt+Tab trigger Windows actions — these system hotkeys can't be intercepted
- Wireless debugging port changes — you may need to reconnect after toggling wireless debugging
- Android 10+ required — older versions may not grant
/dev/uhidaccess
deskflow/
android/
uhid_server.c # C server that creates virtual HID devices on Android
build.sh # Cross-compile script (uses Zig)
src/deskflow/
main.py # Entry point, wires everything together
config.py # Config load/save
controller.py # Orchestrates input capture + forwarding
toggle.py # Hotkey toggle state machine
input_hooks.py # pynput hooks, Win32 cursor control, overlay
sender.py # TCP client sending input to phone
protocol.py # Binary protocol for mouse/keyboard events
adb.py # ADB connection management
tray.py # System tray icon
tests/ # Unit and integration tests
docs/plans/ # Design and implementation docs
- Python (pynput, pystray, pywin32) — Windows app
- C (cross-compiled with Zig) — Android UHID server
- ADB — connection and port forwarding
- UHID (
/dev/uhid) — virtual HID devices on Android
MIT — Brilian Ade Putra