How to disable a faulty key on keyboard, for CLI and GUI
Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How to disable a faulty key on keyboard, for CLI and GUI
The 'H' key on my laptop keeps sending a nigh-constant stream of keypresses without being touched. It slows down boot-ups, interferes with log-ins, and messes up any program that allows text entry. I've found a way to disable keypresses in X:
xmodmap -e 'keycode 43='
However, this doesn't last through a reboot, help boot-up or pre-login difficulties, or work on the console. How else can I disable a key?
There is a thing called xmodmap, which allows you to add local programming to your keyboard layout. But there are 2 issues. You may have an .Xmodmap file in xinit/
1. Every geypress (real or imagined) triggers an interrupt in the box. If you slow your typematic rate to near zero, the repeats are slower, but still cost significant processing.
2. Programs may want your specific key as input, and the issue there can not always be got around by tweaking. This is rarer but occurs.
External keyboard is the way to go. Here's the little beauty I use, same dimensions and layout as a laptop keyboard, small and light enough to carry around and great to type on. I have no association with Cherry Corporation except using and liking their products for over 10 years.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.