On Fri, May 03, 2013 at 08:57:12AM -0400, Todd Showalter wrote: > On Fri, May 3, 2013 at 6:29 AM, Simon Farnsworth > <simon.farnsworth@xxxxxxxxxx> wrote: > > > Could you consider a gamepad equivalent of libv4l2 (source found in > > http://git.linuxtv.org/v4l-utils.git/tree/HEAD:/lib )? > > [8<] > > > A gamepad version would intercept opens of /dev/input/event* nodes, and if > > that node was a gamepad, do the remapping from gamepad-specific events to the > > standard gamepad events. You can then use this with unmodified apps as an > > LD_PRELOAD, or with modified apps as a shared library that only gets in the way > > if the app is accessing a gamepad. > > The problem here is that this really shouldn't be a shared library > if it's going to be accessed directly by (say) games. Unless there's > something I'm missing, accessing /dev/input/event* requires elevated > privileges, and the idea that all games will run as root kind of > terrifies me. Actually not all input devices have to be accessible to root only. We definitely need this for now for keyboards (since we do not have revoke() yet) so that one user would not snoop another users keystrokes, but I think we could relax the restriction for certain devices such as: "A device that emits ABS_X and ABS_Y events and button events in BTN_JOYSTICK - BTN_GAMEPAD ranges and no other key events can be considered a gamepad or joystick device and should be available for read/write by the current console owner". You may want to talk to ConsoleKit/systemd folks and see if they are willing to consider this. Thanks. -- Dmitry -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html