Ubuntu – Volume Control keys (Mute, Volume Up/Down) auto-repeat key presses

keyboardkubuntushortcut-keyssound

I recently installed a fresh Kubuntu 18.04 on my Laptop, most things worked fine out of the box, including most of the multimedia keys for adjusting brightness etc. However, when I press the shortcut for Audio Up, Audio Down or Toggle Audio On/Off (FN+ F1012), it always repeat presses them until I press a different button or put a different window in the foreground. This means It keeps toggling sound on/off or keeps adjusting volume up/down until it is at 0%/100% respectively. It also keeps playing the sound effect repeatedly. The buttons worked fine on Windows 10, so it's likely not a hardware issue. Keyboard is set to generic 105 key (intl.).

I have seen Volume Control keys duplicating on key press, but the proposed solution doesn't work for me. fn+f1012 isn't recognised as an input by the system settings for some reason.

Best Answer

This seems to be an issue with Medion laptops on Linux. I have this problem as well, and there are reports here and here of a similar behavior. It seems that the keyboard of these laptops only sends key press events and not key release events when pressing these three Fn keys. Not sure if this is a hardware problem or some sort of "misunderstanding" between keyboard and OS.

One possible workaround is to go to Keyboard settings > Shortcuts, and map Windows-F10,F11,F12 to the appropriate command:

sh -c 'pactl set-sink-mute 0 toggle'                            Super+F10
sh -c 'pactl set-sink-mute 0 0; pactl set-sink-volume 0 -5%'    Super+F11
sh -c 'pactl set-sink-mute 0 0; pactl set-sink-volume 0 +5%'    Super+F12

and instead of pressing Fn-F10,F11,F12 you'd press Windows-F10,F11,F12.

EDIT: I've posted the answer here.