Native inputs: remotes and gamepads
Status: in progress; only hardware validation is left.
Goal
Read remotes and gamepads outside the browser: media keys arrive as Unidentified or not at all, nothing is read when the screen has no focus, and gamepad repetition does not exist in the kernel. The browser stays the default path; the native path is added where the device can be read.
Steps
| Step | Content | State |
|---|---|---|
| E1 | bobine-devices inputs: raw /dev/input/event* reads, classification by sysfs capabilities (BTN_GAMEPAD is a gamepad; remote keys without a full keyboard is a remote), hat axes turned into BTN_DPAD_*, scan every 2 s, one JSON line per event | done (505) |
| E2 | backend relay app/inputs/native_watch.py (lines bounded to 1 024 characters), translated to key:name or pad:button, broadcast native_input to loopback WebSocket clients only; frontend lib/input/native.ts through the bindings table, a 150 ms cross filter between browser and native paths | done (506) |
| E3 | udev rule packaging/linux/inputs/70-bobine-remotes.rules (uaccess on ID_INPUT_KEY without ID_INPUT_KEYBOARD, USB or Bluetooth bus or rc parent), reloaded at install by the three packages; CI check with uinput and udevadm test | done (507) |
| E4 | Windows: Raw Input on the Consumer Control collection only, never a keyboard; XInput for gamepads, four slots read every 16 ms | done (510) |
| E5 | Android: gamepad buttons only, taken by MainActivity before the WebView while the page claims the path, handed to local WebViews as bobine:native-input | done |
| E6 | macOS: IOKit HID manager limited to Consumer Control, Game Pad and Joystick devices | done (512), not validated on hardware |
Proof so far
Linux desktop: the full chain validated with a virtual uinput gamepad. The udev rule measured with udevadm test: no keyboard opened (internal, virtual, virtual Bluetooth), no power button or Video Bus; a virtual Bluetooth remote opened. Not validated with a real remote or gamepad. Windows and macOS: CI builds and unit tests only.
Pitfalls
In the Android WebView, the D-pad, media keys, channel and page keys arrive with their DOM names, so the browser path is enough; volume never reaches the page and stays with the television. Gamepad buttons arrive as Unidentified followed by Android’s fallback keys. adb injection, even input gamepad, does not create a gamepad for the Gamepad API.