Get Rid Of Annoying “setkeycodes” Messages in Ubuntu
If you have been noticing messages in your logs about unknown key presses I’ve found a solution that gets rid of them.
I had been getting messages like this in my messages log and wanted to get rid of them
kernel: [17204628.240000] atkbd.c: Unknown key pressed (translated set 2, ode 0xd9 on isa0060/serio0).
[17204628.240000] atkbd.c: Use ’setkeycodes e059 keycode’ to make it known.
[17204603.280000] atkbd.c: Unknown key released (translated set 2, code 0×81 on isa0060/serio0).
[17204603.280000] atkbd.c: Use ’setkeycodes e001 keycode keycode’ to make it know.
These errors were randomly generated when I used any keys on my keyboard. There are documented cases of having similar problems with media keys on laptops but nothing to do with regular keys.
I decided that since I was not having any problems using my keyboard that I would simply assign these keys to some empty key code to appease the system.
This is how you do it:
Edit The File:”/usr/share/hotkey-setup/generic.hk”
sudo gedit /usr/share/hotkey-setup/generic.hk
Place these lines in the file, remember to use the values of the keys that appear in your logs, don’t just copy and paste
setkeycodes e059 254
setkeycodes e001 255
Now simply restart the hotkey init script by doing:
sudo /etc/init.d/hotkey-setup restart
Voila those messages should stop appearing in your logs