# deckpad

Phones as Xbox 360 controllers for a Linux PC / Steam Deck, through the phone's browser.
No app on the phone, and only Python's standard library on the Deck.

- `deckpad.py`: HTTP + WebSocket server on :8777. Each phone that connects gets its own
  virtual Xbox 360 pad (045e:028e) made through /dev/uinput, so Steam/SDL map it automatically.
  Phones keep their player slot for 2 minutes after dropping off Wi-Fi. If a phone goes quiet
  for more than 1 s, everything on its pad is released (no stuck buttons).
- `pad.html`: the controller page. It has floating sticks, a d-pad, ABXY, LB/RB, LT/RT (digital),
  Back/Guide/Start, and L3/R3. You can slide a finger between buttons, it vibrates on press,
  and it goes full screen in landscape.
- `install.sh`: installs to ~/.local/share/deckpad as a systemd user service (runs in Game Mode too).
  `--udev` adds the uinput permission rule (sudo). `--remove` uninstalls.
- Join code: 4 digits in ~/.config/deckpad/code. A phone enters it once and remembers it.

Install on the Deck (Desktop Mode, Konsole):
    curl -fsSL https://goldartfrog.net/deckpad/install.sh | bash

Test without hardware: `python3 deckpad.py --fake --code 1234` prints events instead of creating pads.
Published copy: ~/serve/deckpad (served at goldartfrog.net/deckpad).
