clockworkpi

Weird volume up control

IMG_20210911_2039123

Because the ‘volume up’ symbol printed upper like any other symbols that need to be pressed shift key,
I thought I could volume down key with SHIFT. But actually it does not.
I have to press with ‘Fn’ key. I think this is really weird.

I’ll try to adjust keyboard firmware soon, but if anyone knows how to change the key combination for volume down, please let me know. thanks

1 Like

Have you considered going into X11 with either xmodmap or xkb and configuring it so that shift + volume key does “XF86AudioRaiseVolume”. I’ve not tried it myself, but I would imagine it is easier and better documented as it could be done on any Linux(or *BSD) machine.

I did test using xev, evtest and tried to apply modified xkb configuration. But they didn’t work.
It seems Shift+volume-down-key does not produce distinct keycode.

Right, it shouldn’t produce a distinct scan code just from holding down shift. That’s lower level than I’m suggesting. X11 has tables that convert hardware scan codes into key symbols like xev reports. XKB and xmodmap both allow you to specify an array where the first entry is unmodified, the next entry is modified by shift, and so on (control, super, etc).

I looked at ‘xev’ output myself. First I noticed my desktop environment was grabbing the volume key, so I couldn’t see it until I switched to a bare minimum environment. Once I did that I saw key 122. I consider the bottom-left corner of the key to be the “normal” one and the upper right to be the shifted state. so it is a volume down key, the shift is to get a volume up key:

xmodmap -e "keycode 122 = XF86AudioLowerVolume XF86AudioRaiseVolume "

there is a more elegant way to do this using xkb and installing system-wide files in /usr/share/X11/xkb/, but the above in your Xsession file should be sufficient for a quick hack around the problem.

4 Likes

Thank you for the code. But it didn’t work for me either xmodmap in runtime or .xsession.
was able to run with your code?
It will be appreciated if you show how to do that.

There were some limitations to my xmodmap trick and it doesn’t appear compatible with LXDE or GNOME. Sorry! Most likely the implementations use 0 instead of AnyModifier for XGrabButton, while the hot key programs I tried made that configurable and more receptive to hacking.

Long term, I’d recommend using voldown and Fn+voldown to do the lower and raise volume. Even though it seems inconsistent with the other keys on that row, it is the easier route because the Fn key is invisible to X11 so isn’t recorded as a modifier key, unlike Shift.

1 Like