You are not logged in.

#1 2020-09-21 12:38:42

andresdt
Member
Registered: 2020-09-21
Posts: 2

Unable to use XF86 keys with xmodmap

Hello, I recently installed Arch Linux and I have been looking for alternatives for my AHK scripts. I have it set up such as holding Caps lock makes it act as a mod key. For example, Capslock+WASD is a shortcut for the arrow keys.

I'm currently using Xmodmap for this purpose. Everything works as expected except XF86 keys (raise and lower volume, next and previous song...). For example, I tried to bind Capslock+e to raise the volume, but whenever I press it nothing happens. My ~/.Xmodmap file looks like this:

clear Lock
keycode 66 = Mode_switch

keysym a = a A Left
keysym d = d D Right
keysym w = w W Up
keysym s = s S Down
keysym c = c C Home
keysym v = v V End
keysym q = q Q XF86AudioLowerVolume
keysym e = e E XF86AudioRaiseVolume
keysym space = space space XF86AudioPlay

The last three lines don't seem to work. However, if I do the following:

keysym q = q XF86AudioLowerVolume Q

It works as expected (this means that Shift+q lowers the volume, but that isn't what i wanted). The only case in which it doesn't work is when there is a media key in the 3rd "slot". I don't know what might be causing this. Thanks a lot in advance.

Offline

#2 2020-09-21 13:55:59

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,721

Re: Unable to use XF86 keys with xmodmap

"xev -event keyboard" does capslock+e generate any event? Which?
Does eg. "keysym a = a A XF86AudioLowerVolume" work?

Offline

#3 2020-09-21 14:51:38

andresdt
Member
Registered: 2020-09-21
Posts: 2

Re: Unable to use XF86 keys with xmodmap

seth wrote:

"xev -event keyboard" does capslock+e generate any event?

xev -event keyboard

KeyPress event, serial 28, synthetic NO, window 0x1800001,
    root 0x6fa, subw 0x0, time 1132719, (444,-143), root:(467,600),
    state 0x0, keycode 66 (keysym 0xff67, Menu), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 28, synthetic NO, window 0x1800001,
    root 0x6fa, subw 0x0, time 1132875, (444,-143), root:(467,600),
    state 0x0, keycode 26 (keysym 0x65, e), same_screen YES,
    XLookupString gives 1 bytes: (65) "e"
    XmbLookupString gives 1 bytes: (65) "e"
    XFilterEvent returns: False

KeyRelease event, serial 28, synthetic NO, window 0x1800001,
    root 0x6fa, subw 0x0, time 1133168, (444,-143), root:(467,600),
    state 0x0, keycode 26 (keysym 0x65, e), same_screen YES,
    XLookupString gives 1 bytes: (65) "e"
    XFilterEvent returns: False

KeyRelease event, serial 28, synthetic NO, window 0x1800001,
    root 0x6fa, subw 0x0, time 1133452, (444,-143), root:(467,600),
    state 0x0, keycode 66 (keysym 0xff67, Menu), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False
seth wrote:

Does eg. "keysym a = a A XF86AudioLowerVolume" work?

No, any bind involving a media key in the 3rd place is ignored. Thanks for answering.

Offline

#4 2020-09-21 15:04:44

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,721

Re: Unable to use XF86 keys with xmodmap

And w/o "caps:menu" (but eg. caps:none)?

Offline

Board footer

Powered by FluxBB