Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 82705 - Patch: Make xorg-x11 evdev driver not grab the keyboard
Summary: Patch: Make xorg-x11 evdev driver not grab the keyboard
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords: Inclusion
Depends on:
Blocks:
 
Reported: 2005-02-20 10:20 UTC by Luke Maurer (Jyrinx)
Modified: 2005-04-14 16:41 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Remove evdev masking and grabbing code from lnx_kbd.c (9003_all_6.8.2-lnx-evdev-keyboard-dont-grab.patch,1.66 KB, patch)
2005-02-20 10:21 UTC, Luke Maurer (Jyrinx)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Luke Maurer (Jyrinx) 2005-02-20 10:20:29 UTC
As it is, the patched evdev keyboard driver in xorg-x11 tries to use the EVIOCGMASK ioctl and friends, but those ioctls appear to have been removed; failing that, it grabs the event device, which does not appear to be necessary and is a problem in at least my case. (My Logitech Elite keyboard gets exported as two event devices, one of which looks like just a standard keyboard, and the other of which sends both key events for special keys *and* mouse events for the built-in scroll wheel; therefore the wheel doesn't work if that event device has already been grabbed by the keyboard driver.)

This patch comments out both the masking code (which no longer works, at least as of 2.6.10) and the grabbing code in lnx_kbd.c.

Reproducible: Always
Steps to Reproduce:
Comment 1 Luke Maurer (Jyrinx) 2005-02-20 10:21:49 UTC
Created attachment 51688 [details, diff]
Remove evdev masking and grabbing code from lnx_kbd.c
Comment 2 Donnie Berkholz (RETIRED) gentoo-dev 2005-02-20 14:58:46 UTC
So, what could the repercussions of this be on current users? Are there any? Please reopen when you respond.
Comment 3 Luke Maurer (Jyrinx) 2005-02-20 18:58:04 UTC
AFAICT, there are no repercussions. X11 is only happier for me (and nothing's broken console-side either). Besides, the evdev driver is quite obscure right now (both Gentoo's and the one in freedesktop.org CVS have serious deficiencies, and they're pretty well undocumented); it's unlikely many people would be bitten even if there were a problem. (Speaking of the evdev.c in CVS - it never touches the grabbing or masking ioctls, so I'm all the more confident they're unnecessary.)

What didn't work before was this: Since my keyboard reports events over both /dev/input/event3 and event4, with event4 getting special keys and the scroll wheel, I have four input device entries in xorg.conf: One for the keyboard on event3, one for the keyboard on event4, one for the "mouse" on event4 (actually just the mouse events reported for the keyboard, i.e. the scroll wheel), and finally one for the real mouse on event5. The problem was that the keyboard driver monopolized the event4 device by grabbing it, so that the mouse driver couldn't open event4 as well. The keyboard and mouse both worked, except that the keyboard's scroll wheel did not. (The startup log did indeed complain that the event device was busy.) Now that I've patched the keyboard driver not to hog event4, everything's peachy - I can scroll with either the mouse or the keyboard (there's evidently no conflict in having two drivers reading event4). I could post the relevant parts of /etc/X11/xorg.conf and /proc/bus/input/devices if this isn't clear.
Comment 4 Donnie Berkholz (RETIRED) gentoo-dev 2005-02-20 19:02:28 UTC
If you have any interest, Ubuntu's using a similar driver with some extra patches that could be useful to check out.
Comment 5 Donnie Berkholz (RETIRED) gentoo-dev 2005-04-14 16:41:09 UTC
Should be fixed in 6.8.2-r2.