acpi_fakekey sends events to wrong evdev device

Bug #114953 reported by dynamotwain
2
Affects Status Importance Assigned to Milestone
acpi-support (Debian)
Fix Released
Unknown
acpi-support (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: acpi-support

On my system (kernel sources 2.6.20) the event device mappings are as follows:
/dev/input/event0 --> Power Button (FF)
/dev/input/event1 --> Sleep Button (CM)
/dev/input/event3 --> Logitech USB Gaming Mouse
/dev/input/event4 --> AT Translated Set 2 keyboard
/dev/input/event5 --> PC Speaker
/dev/input/event6 --> SynPS/2 Synaptics TouchPad

Since the Power Button evdev interface reports having KEY_POWER available and
KEY_POWER < BTN_MISC, acpi_fakekey as it currently exists sends the keys to
the power button interface instead of the keyboard X is listening on.

acpi_fakekey needs to be more selective as to what it considers a keyboard.

Revision history for this message
dynamotwain (dynamotwain) wrote :

This patch makes acpi_fakekey only consider evdev devices with keys commonly found on all keyboards by requiring the evdev keycode to be less than KEY_MACRO.
KEY_MACRO through BTN_MISC are just F13 - F24 and multimedia, quick launch, and power management keys. Ignoring them allows the real keyboard to be found instead
of power buttons. Also, it makes acpi_fakekey accept a 2nd argument... an overriding evdev device file to use instead of the auto-detect mechanism that might be useful in
the case of multiple keyboards and multiple X-servers running on the same machine.

Revision history for this message
Matthew Garrett (mjg59) wrote :

This shouldn't be an issue - all keyboard events go through to the console, which is what X is listening to. Have you altered your X configuration?

Changed in acpi-support:
status: New → Incomplete
Revision history for this message
dynamotwain (dynamotwain) wrote :

Here's the keyboard portion of my Xorg.conf:
Section "InputDevice"
    Identifier "Keyboard1"
    Driver "kbd"
    Option "AutoRepeat" "250 50"
    Option "XkbModel" "pc104"
    Option "XkbLayout" "us"
    Option "XkbOptions" "compose:menu,lv3:ralt_switch"
    Option "XkbRules" "xorg"
EndSection

There's nothing there to limit input to a specific device. I'm not the only person to have this problem either.
http://blog.eikke.com/index.php/ikke/2007/04/28/how_to_fix_your_acpi_buttons_the_hackish

However, I'm now running 2.6.22, and 'kbd' and 'event0' handle the power button now so the original version works as expected again.

# cat /proc/bus/input/devices
I: Bus=0019 Vendor=0000 Product=0002 Version=0000
N: Name="Power Button (FF)"
P: Phys=button_power/button/input0
S: Sysfs=/class/input/input0
U: Uniq=
H: Handlers=kbd event0
B: EV=3
B: KEY=100000 0 0 0

All in all, it appears to have been a kernel issue.

Revision history for this message
Eric Price (ecprice) wrote :

I have the same problem on Gutsy with my Thinkpad X60s. It's the same as Debian bug 433771 (see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=433771), which has a patch.

Revision history for this message
Ryan Kavanagh (ryanakca) wrote :

Fix released in Debian, and surely sync'd or merged into Ubuntu.

Changed in acpi-support:
status: Incomplete → Fix Released
Changed in acpi-support:
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.