How do I disable a keyboard key in udev? (at driver level)
3
votes
1
answer
506
views
I would like to disable a keyboard key completely, specifically the **XF86Back** (keycode: 166) and **XF86Forward** (keycode: 167) on the Lenovo ThinkPad X220.
For the time being, I disable these two by having these two lines in my .bashrc:
xmodmap -e 'keycode 166='
xmodmap -e 'keycode 167='
This disables the two keys in X11 as soon as I open the terminal (which is very often).
However, ibus overrides these when I change my language, so I have to open the shell in order to deactivate them again. Ibus provides the *"Use system keyboard layout"* option that solves this, but this breaks my language, so that's not an option either. Catch 22.
Since these two keys are causing me a lot of trouble, I would like to just disable capturing them at all, at driver level if possible. **Ideally**, the operating system would behave as if they don't exist, and no program should be able to detect their keypress no matter how low they attempt to go.
Is it possible to permanently disable keyboard keys like this?
Asked by user194515
Jul 7, 2019, 09:56 PM
Last activity: May 14, 2025, 03:24 PM
Last activity: May 14, 2025, 03:24 PM