You are not logged in.

#1 2013-06-03 20:42:33

vtan
Member
Registered: 2013-06-03
Posts: 3

No scancode, keycode > 255 in kernel 3.9

Hi,

After upgrading kernel 3.8.10 to 3.9.3 then 3.9.4 I noticed that the touchpad toggle button (Fn-F9) does not work anymore on my Asus K50I laptop.

I read the Extra Keyboard Keys wiki article and tried to decide what went wrong. xev didn't see anything (no output on key press), showkey wrote 530 on Fn-F9. After some googling I read that all keycodes should be one-byte numbers, so 530 is strange. Then I tried showkey -s and it produced no scancode on Fn-F9. The other Fn keys have scancodes and one-byte keycodes, they are also mapped to Xorg symbols correctly.

So if scancodes are mapped to keycodes, what does it mean if a key has no scancode, but it has a keycode? Also, how is it greater than 255? I would appriciate any ideas how I can fix this.

Offline

#2 2013-06-04 13:49:50

mich41
Member
Registered: 2012-06-22
Posts: 796

Re: No scancode, keycode > 255 in kernel 3.9

And what happens with 3.8.10? You should be able to find old kernel package in /var/cache/pacman/pkg and install it manually.

As for lack of scancode, it's possible that this key is handled somehow differently (ACPI, special laptop driver, etc) and showkey just doesn't know about it - I don't know how exactly showkey works but it probably uses some ancient APIs and isn't very aware of multiple input devices.

Offline

#3 2013-06-05 13:45:28

tomgg
Member
Registered: 2013-05-01
Posts: 40

Re: No scancode, keycode > 255 in kernel 3.9

X11 will ignore keycodes greater than 255. I believe that X11 inherits its keycodes from a kernel table, and the kernel table is generated by the header located (for kernel 3.9) in path-to-src/include/uapi/linux/input.h. This header used to be in .../include/linux/input.h, so it is quite possible that your FN+F9 code was changed.

A simple remedy will be to doctor up the header file and recompile.

Last edited by tomgg (2015-08-29 04:29:53)

Offline

#4 2013-06-06 20:23:11

vtan
Member
Registered: 2013-06-03
Posts: 3

Re: No scancode, keycode > 255 in kernel 3.9

With kernel 3.8.10 the key produces a scancode and a keycode that seem normal (according to showkey).

I swapped the keycode of Fn-F9 and F13 in uapi/linux/input.h so it changes from 530 to 183 and compiled a custom kernel. Now showkey says the keycode of Fn-F9 is 183. However, xev still doesn't recognize the key - it produces KeymapNotify events but no KeyPress or KeyRelease. I tried mapping 138 with xmodmap anyway, but it didn't work.

I also noticed that showkey -s gives a scancode for Fn-F9: 0x5d 0xdd. After some googling I tried mapping this scancode to a keycode with setkeycodes. I tried mapping 5d and dd to 191 and 199 with no success. I also tried mapping 5ddd, but it failed. According to man setkeycodes, 5ddd isn't a valid scancode.

To summarize, now Fn-F9 has a keycode below 255, but X still doesn't see anything.

Offline

#5 2014-02-25 12:47:14

rwilson
Member
Registered: 2013-10-15
Posts: 19

Re: No scancode, keycode > 255 in kernel 3.9

I also have this problem. The Fn+F1 (touchpadtoggle on my sony svs1312) does not have a scancode but has a keycode of 466.

Has anybody found a solution to this problem?

Apparently, one should be using systemd now with keymappings in /etc/udev/hwdb.d. But, first I would like to have access to the key...

Offline

Board footer

Powered by FluxBB