Q: How can I disable one or several keys on my laptop keyboard in Linux? When I press the DELETE key, it gets stuck and deletes everything 🙂
A: No problem! You can use the following command to remap or disable any key of your keyboard:
xmodmap -e 'keycode <value>=<action>'
For example, you could run the following command to disable your DELETE key:
xmodmap -e 'keycode 107='
How to get the correct keycode
You can get the keycode that corresponds to a specific keyboard button in one of two ways.
List of all keycodes
The full list of available keycodes and actions assigned to them on UK keyboard is below…