OK, here's what progress I've made.
I'm still trying to figure out the proper way to trigger generation of a
/dev/input/jsX device node in
[HIDMode] 1;, but I've figured out how to keep it from waggling the mouse around if you want the "4Joy+Mouse" mode without the mouse. (I wasn't thinking "shell script" enough. Using
="" rather than
="0" to disable the "is a mouse" indicators works.)
Here's the updated udev rule...
SUBSYSTEM=="input", ATTRS{name}=="Retrode UG Retrode", MODE="0666", ENV{ID_INPUT_MOUSE}="", ENV{ID_INPUT_TABLET}="", ENV{ID_INPUT_JOYSTICK}="1"
...and here's what I tested with it:
- A Super Famicom controller with AntiMicro (an example of something based on SDL2)
- An N64 controller with Blast Corps in Project64 (an example of a Windows application in Wine)
- A Super Famicom controller with Super Mario World in Snes9x-GTK (because it's a combination you might actually want to use)
I couldn't test under Retroarch because I have no idea how I got it configured in the first place (it's ignoring input from mouse, keyboard, and unrecognized joysticks for me).
As for mednafen, it doesn't recognize
/dev/input/eventX input, but it should be possible to work around that by using
xboxdrv in the mode where it acts as a Linux equivalent to
x360ce. (Raw
/dev/input/eventX in, fake XBox 360 controller
/dev/input/jsX and
/dev/input/eventX out.)
I'd offer a config to do that, but I'd like to see if I can come up with a proper fix before I resort to that. (I have dedicated NES, SNES, Genesis, N64, etc. controller adapters that I normally use because I can mount them to the underside of my desk, and a genuine Microsoft XBox 360 controller, so I've never bothered to learn how to configure xboxdrv to remap things.)
That said, I thought I remembered the Retrode working as a non-bothersome way to use a Genesis controller with mednafen and it turns out that switching to
[HIDMode] 2; (2Joy) produces the working
/dev/input/jsX that I remembered. (If you want a simple way to edit it, Leafpad works for me.)
HIDMode 2 also works with the
http://html5gamepad.com/ link you posted, so I can only assume that browsers are depending on the legacy interface on Linux.
Finally, I did test
[HIDMode] 1;'s
/dev/input/eventX nodes with a Genesis controller and it appears that, while the raw input
is detected by SDL2 and does show up in AntiMicro's joystick-mapping UI, everything but the D-Pad is on such high button numbers (eg. 50) that neither the Wine joystick control panel nor AntiMicro itself are compatible. (xboxdrv may be a solution, though I haven't tested it.)