I have a fresh install of 16.04 on a new Levono Ideapad 500S. I've been trying to make the brightness keys work and have finally managed to hook up the brightness up key to work as expected.

However, I need to change the keycode of my brightness down key in order for it to work, but setkeycodes does not seem to be doing anything.

Running showkey and pressing the brightness down button thrice gives me:

$ sudo showkey -s
kb mode was ?UNKNOWN?
[ if you are trying this under X, it might not work
since the X server is also reading /dev/console ]

press any key (program terminates 10s after last keypress)...
0xe0 0x6f 0xe0 0xef 
0xe0 0x6f 0xe0 0xef 
0xe0 0x6f 0xe0 0xef 

which led me to believe that the scancode of it is e06f. However, running sudo setkeycodes e06f 224 and then running showkey -k still shows the old key code (which was 112).

Can setkeycodes not override an already set keycode from some other source? If so, how can I change the brightness down key's keycode.


setkeycodes will change the key mappings at kernel level itself. Here there is an issue in understanding the scan code values. For key press it's: 0x6f and for release it's :0xef. So the command you need to run is :

sudo setkeycodes 6fef 224 

This will change the mapping to the desired one.

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.