I have the same issue on a Medion P6689 MD61019 and it also exist on Medion E6246 MD63200 for example. You were on the right track; this seemed to do the trick:
Create a text file containing:
# Fix for volume keys on Medion keyboards
evdev:atkbd:dmi:bvn*:bvr*:svnMEDION:pn*:pvr*
evdev:atkbd:dmi:bvn*:bvr*:svnMedion:pn*:pvr*
KEYBOARD_KEY_a0=!mute
KEYBOARD_KEY_ae=!volumedown
KEYBOARD_KEY_b0=!volumeup
Save it to /lib/udev/hwdb.d/99-keyboard-medion-vol-fix.hwdb
and run the following commands as root:
systemd-hwdb update
udevadm trigger --verbose --sysname-match="event*"
and done! Volume keys now work normally.
Note: Since it appears to have no side effect (since this Patch is only applied by people affected), the :pn*
field is not limiting it to any model. Though it can be easily changed to match only a few models, by specifying their product number.
(You may want to check /sys/class/dmi/id/modalias
for your specific vendor ID and product number.)
From /lib/udev/hwdb.d/60-keyboard.hwdb:
# Supported hardware matches are:
...
# - AT keyboard DMI data matches:
# evdev:atkbd:dmi:bvn*:bvr*:bd*:svn<vendor>:pn<product>:pvr*
# <vendor> and <product> are the firmware-provided strings
# exported by the kernel DMI modalias, see /sys/class/dmi/id/modalias
...
# An '!' as the first character of the key identifier string
# will add the scan code to the AT keyboard's list of scan codes
# where the driver will synthesize a release event and not expect
# it to be generated by the hardware.
...
# To update this file, create a new file
# /etc/udev/hwdb.d/70-keyboard.hwdb
# and add your rules there. To load the new rules execute (as root):
# systemd-hwdb update
# udevadm trigger /dev/input/eventXX
# where /dev/input/eventXX is the keyboard in question. If in
# doubt, simply reload all input rules
# udevadm trigger --verbose --sysname-match="event*"
...
# Akoya
evdev:atkbd:dmi:bvn*:bvr*:svnMEDION*:pnS3409*:pvr*
evdev:atkbd:dmi:bvn*:bvr*:svnMedion*:pnAkoya*:pvr*
KEYBOARD_KEY_a0=!mute
KEYBOARD_KEY_ae=!volumedown
KEYBOARD_KEY_b0=!volumeup
KEYBOARD_KEY_19=!p
KEYBOARD_KEY_df=sleep
In short, some Medion laptop keyboards need a !
for the volume keys (and maybe also the p
key, whatever it is) because they don't generate key release events; however, not all Medion models are covered by default in /lib/udev/hwdb.d/60-keyboard.hwdb.
Strangely enough, after this fix, pressing and holding the volume keys DOES auto-repeat them until you release the key.