Thread (31 messages) 31 messages, 8 authors, 2013-09-07

Re: Game Controllers

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2013-05-03 16:01:47

On Fri, May 03, 2013 at 08:57:12AM -0400, Todd Showalter wrote:
On Fri, May 3, 2013 at 6:29 AM, Simon Farnsworth
[off-list ref] wrote:
quoted
Could you consider a gamepad equivalent of libv4l2 (source found in
http://git.linuxtv.org/v4l-utils.git/tree/HEAD:/lib )?
[8<]
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help