How to disable a keyboard key in Linux Ubuntu 18 04

Опубликовано: 04 Май 2026
на канале: Justin Jacob
12,331
66

If any of your laptop keys are making false key presses, then it is better to disable that one. So we can use an external one without any problems.

This video describes the steps to disable faulty laptop keys.

OS: Ubuntu 18.04

Commands used:
---------------------------------------------------------

#!/bin/bash

xmodmap -e 'keycode 171='
xmodmap -e 'keycode 172='
xmodmap -e 'keycode 173='
xmodmap -e 'keycode 174='

---------------------------------------------------------

xmodmap -pke

---------------------------------------------------------

chmod a+x disable_key

---------------------------------------------------------

mv disable_key /usr/bin/disable_key

---------------------------------------------------------