How to Disable Any Keyboard Button In Linux

How to Disable Any Keyboard Button In Linux

  1. Connect a USB keyboard in there, or get into the machine using ssh.
  2. Open a terminal, and run xev. It will show some stuff on screen (too much stuff, but don’t worry). You will notice that it will show some more stuff if you move your mouse, as well.

 

  1. Then, press the key combination you want to disable [é]. The info in the screen will change, and you will have to look for the keycode value.
  2. Run something like this, changing <value> for the value you got for the keycode in the last step:
    xmodmap -e 'keycode <value>='
    

    For example, if I want to disable the ~ key ( Shift + ` ), I would have to run:Screenshot from 2015-09-25 10:36:12

    xmodmap -e 'keycode 49='

 

Screenshot from 2015-09-25 10:37:08

I have only tried this with more standard keys, like Caps Lock..Numeric & alphabats. but I guess it should work with this as well. I hope this helps!

Back to top button
Close