I have a peripheral attached that is actually not a keyboard, but all of its buttons are being treated as F keys, they all send the same scancode and keycode as the standard F keys (based of of showkey [-s] and xev). I want to change the keycode of the peripheral without effecting the standard keys, so I seetled on udev to remap the scancodes based on manufacturer.

The problem I'm having now is getting the keys to remap at all using udev. I have created /usr/lib/udev/hwdb.d/90-custom-keys.hwdb for testing (the test version aims to change all keyboards, which I'll adjust once I can get something working) that looks like:

 KEYBOARD_KEY_1b=playcd (this should map F1 to keycode 200 like I want)

The peripheral is USB, the added sections are attempted catch alls to get some kind of behaviour change which were each added after the previous didn't help.

Also, udev does appear to be running based off of ps aux | grep udev.

I need to be able to change the keycodes this peripheral sends which will be handled by another application (that requires particular keycode inputs), and I still want to maintain the standard buttons. How can I achieve this?

Environment used:

os: RHEL 7
udev ver: 208
arch: 86_64

1 Answer 1


My issue was putting the wrong scancode, the rule shouldn't be




You really do require evtest for this (the 'scancodes' provided by showkey -s is not the one you're looking for)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.