0

My laptop keyboard has been water damaged and the left control key occasionally activates.

I am aware of xmapmod -e "keycode 37=" to disable the left control key. I seek to do something else as this causes a new problem. When I hold down any other key, e.g. 'a', a will be repeatedly typed until left ctrl activates. Although left control doesn't do anything now (thanks to xmapmod), it still interrupts key hold down.

I suppose that I need to stop the keyboard even listening for the left control key.

Does anyone have a fix for this? I am using linux mint. Thanks

2
  • A new desktop keyboard could be less than US$20. Would it be worthwhile just to get a new keyboard. Cost is more like US$80 for a laptop keyboard replacement so this might be more than you want to pay.
    – doneal24
    Feb 28, 2022 at 20:16
  • I forgot to mention that it is a built in laptop keyboard, hence my interest in the one key. Sadly it is a weird laptop and I can't find a keyboard replacement
    – Josh L.
    Feb 28, 2022 at 21:05

2 Answers 2

0

To "fully disable a key" in a sense that would help a water-damaged keyboard, I think you would have to reprogram the keyboard controller chip in the keyboard itself, or to physically modify the keyboard wire matrix to cut out/bypass the failing key.

Unless your keyboard is somehow special, it's probably not worth the trouble. If you want to try repairing the old one, get a replacement/substitute keyboard first: it's no fun to make an emergency run to a computer hardware store after you've discovered the hard way that you didn't know the trick to take the old keyboard apart non-destructively. (Been there, done that.)

1
  • okay it sounds like I'll just have to leave it then. It is a built in laptop keyboard which is why it is special. I can still type which I guess is good enough. Thanks for your answer
    – Josh L.
    Feb 28, 2022 at 21:04
0

If you really want to disable the key it can be done by remapping it at the kernel level (udev). This is a rather an involved process. This article has a section on how to block the sleep key, which you could use for your dead control key.

An outline of the steps:

  1. Identify the input device ID of the keyboard using evemu-describe.
  2. Identify the key code you wish to block using evtest.
  3. Create a custom key code file in /etc/udev/hwdb.d/50-block-ctrld.hwdb.
  4. Add the device id to top file.
  5. Add KEYBOARD_KEY_xxx=reserved to file where xxx is the key code.
  6. Apply the custom key code file using systemd-hwdb and udevadm.

Note that step 4 is complected because you must get the device id formatted correctly or nothing will happen. This article has a good description on how to identify the keyboard event source and key codes. I've also outlined the steps in this answer.

As others have pointed out there may be a better solution to your problem. However should you really want to disable the key, this process should do it.

1
  • This sounds wonderful! I will try it. Thank you for your detailed answer!
    – Josh L.
    Mar 3, 2022 at 12:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .