Ubuntu – Swap F keys to perform functions without Fn key


My laptop has a function key which turns F keys into keys which change volume or brightness. I would like to swap a number of them so that they perform that function under normal operation and are an Fx key while the function key is being held.

I assumed that the function keys were just normal keys codes with the set of keys being large enough to include all the possible speical keys. I tried to so as this tutorial suggests (How do I remap certain keys or devices?) and use xev to obtain the key codes and then would use xmodmap to swap their value.

This does not seem to work though. The F12 key gives the xev output:

KeyPress event, serial 41, synthetic NO, window 0x4a00001,
    root 0xb1, subw 0x0, time 468005, (23,-15), root:(89,37),
    state 0x10, keycode 96 (keysym 0xffc9, F12), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

Which I think is to be expected. However, the Increase Volume button give this response:

KeymapNotify event, serial 41, synthetic NO, window 0x0,
    keys:  65  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0 

And so does the Decrease Volume key. How can I perform the swapping of the keys that I would like?

Thank you

Best Answer

Usually laptops have a setting in the BIOS which does this for you. When I got my laptop (an HP), it did this and I was able to change it. This is probably your best option.

Related Question