Put your phone in your pocket and walk around your room. Your character walks in Death Stranding, Minecraft, or any WASD game. Your phone's pedometer detects each step, fires a UDP packet at your PC over WiFi, and the PC taps W.
One step in your room is one keypress on your PC. Nothing goes through the internet — the phone talks straight to your desktop over your own WiFi.
flowchart LR
A["🚶 You take a step"] --> B["📱 Android<br/>StepDetectionService<br/>TYPE_STEP_DETECTOR"]
B --> C["📡 UDPSender<br/>sends ASCII 'STEP'"]
C -->|"UDP :9000 over LAN"| D["💻 Windows<br/>UDPListener<br/>background thread"]
D --> E["⌨️ KeySender<br/>pyautogui keyDown/keyUp"]
E --> F["🎮 Character moves forward"]
The entire protocol is one datagram carrying the four bytes STEP. That's it — no handshake, no session, no acknowledgement. A dropped packet just means a missed step, which is why UDP is the right choice here rather than TCP: a late step is worse than a lost one.
GameWalkingAndroid/ Kotlin app - detects steps, sends UDP
app/src/main/java/com/example/gamewalking/
MainActivity.kt IP + port entry, start/stop, permissions
StepDetectionService.kt foreground service, sensors, wake lock
UDPSender.kt DatagramSocket, fire-and-forget "STEP"
GameWalkingWindows/ Python app - receives UDP, presses keys
main.py entry point, GUI or --no-gui console mode
udp_listener.py threaded socket listener, step counter, status
key_sender.py pyautogui key press with configurable hold time
gui.py tkinter control panel, tray icon, live log
config.py gamewalking_config.ini read/write
build_exe.py PyInstaller build to a standalone .exe
firewall_setup.bat adds the inbound UDP 9000 rule
docs/SETUP.md the long-form setup, gaming and troubleshooting guide
The Android service uses three strategies, in order of preference:
| Sensor | Role |
|---|---|
TYPE_STEP_DETECTOR |
Primary. Fires once per step, lowest latency |
TYPE_STEP_COUNTER |
Backup. Registered alongside; fires on cumulative count increase |
TYPE_ACCELEROMETER |
Fallback for phones with no pedometer — magnitude delta over a threshold of 12f, debounced to one step per 500 ms |
It runs as a foreground service with a PARTIAL_WAKE_LOCK, so detection survives the screen turning off and the phone going in your pocket.
git clone https://github.com/moeezalam/GameWalking.git
cd GameWalking/GameWalkingWindows
pip install -r requirements.txt
python main.pyThen, as Administrator, allow the port through the firewall — this is the single most common reason nothing happens:
netsh advfirewall firewall add rule name="GameWalking" dir=in action=allow protocol=UDP localport=9000Or just right-click firewall_setup.bat → Run as administrator.
In the app: Start Listener, then Activate Key Sender.
Find your PC's LAN address with ipconfig — the IPv4 address on your WiFi adapter, something like 192.168.1.100.
Prefer no Python on the gaming machine? python build_exe.py produces a standalone GameWalking.exe via PyInstaller.
Open GameWalkingAndroid/ in Android Studio, plug in your phone with USB debugging on, and hit Run. Or Build → Build APK(s) and sideload the APK from app/build/outputs/apk/debug/.
Grant Activity Recognition (step detection) and Notifications (the foreground service) when asked.
Enter your PC's IP, leave the port at 9000, tap Start Step Detection, pocket the phone.
Launch your game, make sure its window has focus, and walk. The desktop app's step counter should climb with every stride.
Full walkthrough with per-game notes and troubleshooting: docs/SETUP.md.
Settings live in gamewalking_config.ini, created next to the app on first run and editable from the GUI.
| Section | Key | Default | Meaning |
|---|---|---|---|
NETWORK |
port |
9000 |
UDP listen port |
NETWORK |
buffer_size |
1024 |
Receive buffer |
CONTROLS |
forward_key |
w |
Key pressed per step — change for arrow-key or racing games |
CONTROLS |
key_hold_duration |
0.05 |
Seconds the key is held down per step |
CONTROLS |
step_duration |
0.1 |
Loaded and saved, but currently unused — key_hold_duration is what governs the press |
GENERAL |
debug_mode |
false |
Log every packet received |
GENERAL |
minimize_to_tray |
true |
Hide to system tray instead of closing |
Console mode, no GUI:
python main.py --no-gui --port 9000 --debugStated plainly, because they'll shape whether this works for you:
- Same WiFi network only. There's no relay, no cloud, no NAT traversal. Phone and PC must be on the same LAN.
- No authentication. Anything on your network that can reach UDP 9000 can move your character. Fine at home; don't run it on public WiFi.
- Forward only. One step maps to one forward keypress. Turning, strafing and running still come from your keyboard and mouse.
- Some games ignore synthetic input.
pyautoguiinjects OS-level key events. Most games accept them, but titles using raw input capture or kernel-level anti-cheat may not — test in a single-player game first, and be aware that automated input can violate the terms of service of multiplayer games. - One-way protocol. The PC never replies, so the phone can't tell you whether the packets are landing. Watch the desktop step counter instead.
- Windows-only receiver. The listener is portable Python, but the firewall script and the packaging are Windows-specific.
- Battery. A foreground service holding a wake lock and reading sensors at
SENSOR_DELAY_FASTESTwill drain your phone faster than normal.
Clear, self-contained places to help:
- A macOS and Linux receiver — the listener is plain Python; it's mostly the key-sending layer and firewall docs that need porting
- Pace-based movement — hold the key while the step rate stays above a threshold, instead of tapping per step, for smoother walking
- Auto-discovery — mDNS or a UDP broadcast so you never have to type an IP address
- A shared secret in the packet, so a stray device on the LAN can't drive your character
- Two-way status — let the PC acknowledge, so the phone can show "connected" instead of guessing
- Gamepad output — emit a virtual controller axis via ViGEm so analog-movement games work properly
- Rename the package from
com.example.gamewalkingbefore anyone ships this to a store
MIT — see LICENSE.
Walked a kilometre in Death Stranding without leaving your room? Star the repo.