Skip to content

Optional addon: make gamepads visible to Steam/Proton and in-desktop browsers#274

Open
h012193213 wants to merge 2 commits into
selkies-project:mainfrom
h012193213:fix/gamepad-reconnect-and-optional-uinput
Open

Optional addon: make gamepads visible to Steam/Proton and in-desktop browsers#274
h012193213 wants to merge 2 commits into
selkies-project:mainfrom
h012193213:fix/gamepad-reconnect-and-optional-uinput

Conversation

@h012193213

@h012193213 h012193213 commented Jul 9, 2026

Copy link
Copy Markdown

Summary

  • Steam / Proton / browsers inside the remote desktop often never see a Selkies pad because the default LD_PRELOAD interposer does not create a real /dev/input device. This PR adds an optional addons/uinput-bridge path (SELKIES_ENABLE_UINPUT_BRIDGE, off by default) that mirrors pads to a kernel Xbox-like controller when /dev/uinput is available.
  • Also fixes a general reconnect gap: after WebRTC/page refresh the UI can show a pad while the server drops events (jsN is not connected). Client re-sync + server recreate/associate recover that without enabling uinput.

Addresses #168. Keeps uinput optional per #95 (LD_PRELOAD remains default).

Test plan

  • Without SELKIES_ENABLE_UINPUT_BRIDGE: connect over HTTPS, verify gamepad works for LD_PRELOAD apps; refresh/reconnect and confirm buttons still work (no js0 is not connected spam).
  • With SELKIES_ENABLE_UINPUT_BRIDGE=true, python-evdev, and /dev/uinput access: confirm a kernel device appears; restart Steam and verify controller detection; check html5gamepad.com inside the remote desktop.
  • Confirm default install still does not require /dev/uinput.

Re-sync browser pads after WebRTC reconnect and recover missing server
associations so js events are not dropped. Add optional
SELKIES_ENABLE_UINPUT_BRIDGE (off by default) for Steam/Proton and
in-desktop browsers that need a real kernel controller, without changing
the default LD_PRELOAD interposer path.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.

@h012193213 h012193213 changed the title fix(input): gamepad reconnect sync and optional uinput bridge Optional addon: make gamepads visible to Steam/Proton and in-desktop browsers Jul 9, 2026
@ehfd

ehfd commented Jul 9, 2026

Copy link
Copy Markdown
Member

I prefer making Steam / Proton / browsers work in the current architecture, rather.

I did find an issue where a refresh of Selkies makes the gamepad disappear (works on html5gamepad.com the first time Selkies is accessed), so let me fix that, first.

Keep SELKIES_ENABLE_UINPUT_BRIDGE as the supported path and note that
legacy socket-only deployments without the flag are out of scope.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants