Skip to content

Make gamepad discovery explicit across platforms - #8

Open
monofuel wants to merge 4 commits into
treeform:masterfrom
monofuel:anbernic-handhelds
Open

monofuel wants to merge 4 commits into
treeform:masterfrom
monofuel:anbernic-handhelds

Conversation

@monofuel

@monofuel monofuel commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

I'm using Paddy in mono-retro-player and on mdev handhelds. Those handheld controllers have no udev joystick labels, so the sysfs/evdev fallback is needed to discover them. I've manually tested the original mdev fallback on the RG SP and RG DS Plus.

Automatic discovery can stall game frames on Windows, including keyboard/mouse games with no controller connected. Applications should choose when to pay that cost. Startup discovery stays, while new or reconnected controllers require an explicit scanGamepads() call on every platform. Per-frame polling reads known controllers and handles disconnections.

CI passes on Linux, Windows, and macOS, including native lifecycle checks and fake-device discovery regressions. The real Emscripten backend also passes a WASM/Chromium connect, rescan, and disconnect test.

@monofuel

monofuel commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor Author
IMG_20261021_155347_811 ((nim testing app, green means the button worked))

@monofuel monofuel changed the title Support Anbernic RG SP and RG DS Plus controllers on Linux Support mdev controller discovery on Linux Oct 21, 2026
@monofuel
monofuel marked this pull request as ready for review October 22, 2026 02:29
@monofuel monofuel changed the title Support mdev controller discovery on Linux Make gamepad discovery explicit across platforms Nov 10, 2026
@monofuel

Copy link
Copy Markdown
Contributor Author

Updated with better distinction of scan / polling logic.

scanning for gamepads when polling for input was very bad performance on some platforms. pollGamepads() now only handles gamepad input, and scanGamepads() handles discovery.

This branch has not been deployed

No deployments
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.

1 participant