Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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

StepContentState
E1bobine-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 eventdone (505)
E2backend 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 pathsdone (506)
E3udev 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 testdone (507)
E4Windows: Raw Input on the Consumer Control collection only, never a keyboard; XInput for gamepads, four slots read every 16 msdone (510)
E5Android: gamepad buttons only, taken by MainActivity before the WebView while the page claims the path, handed to local WebViews as bobine:native-inputdone
E6macOS: IOKit HID manager limited to Consumer Control, Game Pad and Joystick devicesdone (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.