You are not logged in.

#1 2010-05-29 05:44:36

lagagnon
Member
From: an Island in the Pacific...
Registered: 2009-12-10
Posts: 1,087
Website

Keyboard has some keycodes without scancodes

Using a Logitech MK300 USB wireless keyboard and Arch x86_64. I want to map the multimedia keys. Mostly successful, but amazingly enough a few of these keys have keycodes without scancodes, so even if I map the keycode to a keysym in my .Xmodmap it does not work for the few keys that do not have scancodes. From my reading anything without a scancode cannot be used as the kernel basically cannot see the keystroke (but why does it see a keycode then???). I don't see the scancodes in dmesg either.

Any ideas appreciated.

Update: http://bbs.archlinux.org/viewtopic.php?id=76328
It seems possibly that keycodes above 255 don't have scancodes??? Is this correct and anyone yet found a way around this??

2nd Update: https://bugs.launchpad.net/linux/+bug/313514
Seems like it is definitely an X and evdev bug, and there might be a workaround as posted at the bottom of that bug report. I will report back if I have any luck trying the workarounds....

Last edited by lagagnon (2010-05-29 05:59:22)


Philosophy is looking for a black cat in a dark room. Metaphysics is looking for a black cat in a dark room that isn't there. Religion is looking for a black cat in a dark room that isn't there and shouting "I found it!". Science is looking for a black cat in a dark room with a flashlight.

Offline

#2 2010-05-29 11:05:28

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: Keyboard has some keycodes without scancodes

Do they show up in /dev/input/event1? (or which one your keyboard is)

Offline

#3 2010-05-29 13:36:14

lagagnon
Member
From: an Island in the Pacific...
Registered: 2009-12-10
Posts: 1,087
Website

Re: Keyboard has some keycodes without scancodes

Procyon wrote:

Do they show up in /dev/input/event1? (or which one your keyboard is)

No they don't.


Philosophy is looking for a black cat in a dark room. Metaphysics is looking for a black cat in a dark room that isn't there. Religion is looking for a black cat in a dark room that isn't there and shouting "I found it!". Science is looking for a black cat in a dark room with a flashlight.

Offline

#4 2010-05-29 13:52:41

Coacher
Guest

Re: Keyboard has some keycodes without scancodes

dumpkey -i

will give you the answer about 256 keycodes.


Also, this part of man showkey may be useful for you. It explains missing scancodes:

In 2.6 kernels key codes lie in the range 1-255, instead of 1-127.
Key codes larger than 127 are returned as three bytes of which the
low order 7 bits are: zero, bits 13-7, and bits 6-0 of the key code.
The high order bits are: 0/1 for make/break, 1, 1.

In 2.6 kernels raw mode, or scancode mode, is not very raw at all.
Scan codes are first translated to key codes, and when scancodes
are desired, the key codes are translated back. Various transformations
are involved, and there is no guarantee at all that the final result
corresponds to what the keyboard hardware did send. So, if you want
to know the scan codes sent by various keys it is better to boot a
2.4 kernel. Since 2.6.9 there also is the boot option atkbd.softraw=0
that tells the 2.6 kernel to return the actual scan codes.

Last edited by Coacher (2010-05-29 13:53:11)

Board footer

Powered by FluxBB