We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2654

Summary: ID_INPUT_KEY devices skipped
Product: SDL Reporter: Phil Spencer <phil>
Component: *don't know*Assignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: amaranth72, gabomdq, kholm40
Version: 2.0.3   
Hardware: x86_64   
OS: Windows 7   

Description Phil Spencer 2014-07-18 20:22:08 UTC
SDL_udev.c only adds input devices that identifies as ID_INPUT_MOUSE, ID_INPUT_JOYSTICK or ID_INPUT_KEYBOARD on the Raspberry Pi there are projects that create input over the GPIO using uinput/udev and they are usually identified as ID_INPUT_KEY for a keyboard or ID_INPUT_REL or ID_INPUT_ABS for mice. 

I understand that most platforms this is a non issue but given that platforms like the Pi allow one to create your own input devices this can and is posing a problem to anyone like myself who uses a GPIO interface to simulate input buttons as keys.

I added my own ID_INPUT_KEY block to SDL_udev.c as a simple test and it worked perfectly with no adverse affects other than it resolved my problem.

https://github.com/CrazySpence/Adafruit-Retrogame/blob/master/SDL2.0.3/src/core/linux/SDL_udev.c
Comment 1 Gabriel Jacobo 2014-07-19 13:39:20 UTC
Isn't this a udev configuration problem? Or put differently, can you add ID_INPUT_KEYBOARD=1 to your device using a udev rule?
Comment 2 Phil Spencer 2014-07-21 22:41:49 UTC
Sure I could use a udev rule but retrogame isn't just used by me (or created by me) it is a fairly popular gpio-> key input program used by lots of rpi users. 

Not to mention this worked fine with ol sdl 1.2...

The greater concern I would have is what other uinput created devices is this possibly affecting that maybe just have not been reported yet.
Comment 3 kenneth Holm 2014-07-24 01:43:40 UTC
It would be great to have this fixed. I came across this issue myself where my project stopped working after the update. I searched many forums trying to find a solution and encountered dozens of other people that have the same problem and were looking for a solution as well.
Comment 4 Gabriel Jacobo 2014-10-16 12:42:12 UTC
Fixed here: https://hg.libsdl.org/SDL/rev/b8e85a5ac99a