So I want to nuke InputHandler_Linux_Joystick because it's laughably primitive, and InputHandler_Linux_Event can handle the joysticks with very little work. It just needs some better detection logic.
That logic should look something like:
1. Find all /sys/class/input/inputNN
For each inputNN:
2. If the device is of a blacklisted type (preference metric; keyboard and mouse by default) skip it. (I'm not exactly sure how we would detect the device type -- I know udev can but I don't see an obvious flag in sysfs.)
3. First try to open the corresponding eventX (Just check for event* in /sys/class/input/inputNN/ and try the corresponding device in /dev/input). If that fails, try to open the corresponding jsX if it exists (same deal, but try both). If THAT fails, or there is no jsX, and the device is in fact a joystick, throw a warning.
What about systems without sysfs? Fuck them. They're probably still running 2.4 which is like 12 years old now.
That logic should look something like:
1. Find all /sys/class/input/inputNN
For each inputNN:
2. If the device is of a blacklisted type (preference metric; keyboard and mouse by default) skip it. (I'm not exactly sure how we would detect the device type -- I know udev can but I don't see an obvious flag in sysfs.)
3. First try to open the corresponding eventX (Just check for event* in /sys/class/input/inputNN/ and try the corresponding device in /dev/input). If that fails, try to open the corresponding jsX if it exists (same deal, but try both). If THAT fails, or there is no jsX, and the device is in fact a joystick, throw a warning.
What about systems without sysfs? Fuck them. They're probably still running 2.4 which is like 12 years old now.