You are not logged in.

#1 2016-11-20 03:19:05

cmg
Member
Registered: 2016-10-22
Posts: 4

External keyboard media keys do not repeat

Hi,

I have an external, mechanical keyboard by WASD keyboards (CODE keyboard). When I press and hold every key on my keyboard, it repeats, with the exception of the media keys (brightness up/down, volume mute, volume up/down, etc.). When I hold them down, they repeat once.

The do, however, repeat on the internal laptop keyboard. The puzzling aspect to me is that the xev outputs are almost identical.

Here is what I get when I hold the 'Volume Up' key (F12) on my internal keyboard:

FocusOut event, serial 33, synthetic NO, window 0x1a00001,
    mode NotifyGrab, detail NotifyAncestor

FocusIn event, serial 33, synthetic NO, window 0x1a00001,
    mode NotifyUngrab, detail NotifyAncestor

KeymapNotify event, serial 33, synthetic NO, window 0x0,
    keys:  2   0   0   0   0   0   0   0   0   0   0   0   1   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   

Here is what I get when I hold the volume up combo (Fn + PgUp) on my CODE keyboard:

MappingNotify event, serial 32, synthetic NO, window 0x0,
    request MappingKeyboard, first_keycode 8, count 248

FocusOut event, serial 32, synthetic NO, window 0x1000001,
    mode NotifyGrab, detail NotifyAncestor

FocusIn event, serial 33, synthetic NO, window 0x1000001,
    mode NotifyUngrab, detail NotifyAncestor

KeymapNotify event, serial 33, synthetic NO, window 0x0,
    keys:  2   0   0   0   0   0   0   0   0   0   0   0   1   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   

I can't figure out why the first one repeats while the second one does not.

I'm assuming that the MappingNotify event has to do with the holding of the Fn key on the external keyboard, which does nothing.

I'm also sure that this can to be dealt with in the operating system, since the volume up key does repeat with my external keyboard on OS X (same laptop, dual boot).

Thanks.

EDIT: I should also mention that, on the CODE keyboard, the Fn/media keys are enabled via a DIP switch on the back, while the internal keyboard seems to have the media keys enabled by default.

Last edited by cmg (2016-11-23 23:58:38)

Offline

#2 2016-11-20 08:27:50

seth
Member
Registered: 2012-09-03
Posts: 51,170

Re: External keyboard media keys do not repeat

You should test xev w/o the key being grabbed by some shortcut daemon so you'll see the press/release events that turn into the system and distinguish, whether either only one is repeated by the system or both are repeated by the client only.

Also you can then try "xset r <keycode>" for the non-repeating keycode and see whether that makes a difference.

Online

#3 2016-11-22 18:44:03

cmg
Member
Registered: 2016-10-22
Posts: 4

Re: External keyboard media keys do not repeat

xset r 122 and 123 don't work, unfortunately.

Here's the xev output to the internal keyboard without sxhkd grabbing:

MappingNotify event, serial 48, synthetic NO, window 0x0,
    request MappingKeyboard, first_keycode 8, count 248

KeyPress event, serial 48, synthetic NO, window 0xe00001,
    root 0xd7, subw 0x0, time 3040895, (96,55), root:(2730,1555),
    state 0x0, keycode 123 (keysym 0x1008ff13, XF86AudioRaiseVolume), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 49, synthetic NO, window 0xe00001,
    root 0xd7, subw 0x0, time 3040991, (96,55), root:(2730,1555),
    state 0x0, keycode 123 (keysym 0x1008ff13, XF86AudioRaiseVolume), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

And here's the xev for the external keyboard:

MappingNotify event, serial 46, synthetic NO, window 0x0,
    request MappingKeyboard, first_keycode 8, count 248

KeyPress event, serial 46, synthetic NO, window 0xe00001,
    root 0xd7, subw 0x0, time 2917385, (117,130), root:(2751,1630),
    state 0x0, keycode 123 (keysym 0x1008ff13, XF86AudioRaiseVolume), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 46, synthetic NO, window 0xe00001,
    root 0xd7, subw 0x0, time 2917385, (117,130), root:(2751,1630),
    state 0x0, keycode 123 (keysym 0x1008ff13, XF86AudioRaiseVolume), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

Offline

#4 2016-11-22 20:21:41

seth
Member
Registered: 2012-09-03
Posts: 51,170

Re: External keyboard media keys do not repeat

If there's no further output, it seems serverside autorepeat doesn't occur for either of those keys (what's weird, sxhkd doesn't seem to do client side repeating)
An interesting detail is that the serial increments for the working internal, but not the non-working external keyboard, maybe due to the Fn key.

Have a look at "xinput" and the structure of the devices. Sometimes multimedia keys are a second device and sometimes, that shows up as pointer rather than as keyboard. Maybe there's a difference?

Online

#5 2016-11-22 23:17:16

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

Re: External keyboard media keys do not repeat

FWIW, xev reports repeated KeyPresses for XF86AudioRaiseVolume on my USB keyboard.

Run evtest to see if the kernel doesn't by any chance report this key as released immediately after it's pressed.

Offline

#6 2016-11-23 23:51:59

cmg
Member
Registered: 2016-10-22
Posts: 4

Re: External keyboard media keys do not repeat

i was wrong. xev does repeat the keypresses for the internel keyboard but not the external one.

when I run `sudo evtest` I get two devices for my external keyboard event6 and event12. event6 repeats all the other keys but does not pickup the media keys. event12 picks up only the media keys and does not repeat.

Event: time 1479945312.761729, -------------- SYN_REPORT ------------
Event: time 1479945314.705701, type 4 (EV_MSC), code 4 (MSC_SCAN), value c00e9
Event: time 1479945314.705701, type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 1
Event: time 1479945314.705701, -------------- SYN_REPORT ------------
Event: time 1479945314.705723, type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 0
Event: time 1479945314.705723, -------------- SYN_REPORT ------------

Last edited by cmg (2016-11-23 23:55:33)

Offline

#7 2016-11-24 07:50:30

seth
Member
Registered: 2012-09-03
Posts: 51,170

Re: External keyboard media keys do not repeat

So what does xinput look like (sonds much like the media keys are an extra device which is considered to be a pointer)

Online

#8 2016-11-24 09:07:00

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

Re: External keyboard media keys do not repeat

So evtest reports that the key was released after 22μs. That's pretty fast smile

This has nothing to do with X at this point. Either kernel bug or hardware limitation. Are you sure it's not a known issue with this model of keyboard?

The next logical step would be to monitor USB communication with wireshark and see if the keyboard sends any notification when the key is released.

Offline

Board footer

Powered by FluxBB