Forums » StepMania Development » Bringing InputHandler_Linux_Event up to speed

1
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.
Reply
As it turns out I had to go a bit of a different direction. If you're curious you know where the repo is, it's all committed.

Unfortunately I'm going to need to study this:

http://cgit.freedesktop.org/systemd/systemd/tree/src/udev/udev-builtin-input_id.c

Last edited: 29 November 2013 10:41pm

Reply