I've got a keyboard (razor black widow stealth) that is malfunctioning in such a way that it periodically sends duplicate key presses for various keys (h and n) so far. I'm looking for ways to delay the purchase of a new one in software.

I'm currently on Kubuntu 18.04. Is there any way to throttle key presses so that 2 key presses of the same key within 500ms (for example) would only register as a single key press? I tried extending the duration of repeat delay to see if it was just being pressed too long but it does look like the keyboard is sending duplicate presses.

  • Could it be a defective keyboard? Nov 4, 2018 at 16:28
  • It definitely is a defective keyboard. I'm trying to compensate for it. Nov 4, 2018 at 23:27

1 Answer 1


If the issue is consistent, you could rig xdotool (install with sudo apt-get install xdotool -y to press backspace immediately after each of these keypresses to delete one of the two keystrokes, then set up a keyboard shortcut to each of the trouble keys to run xdotool key Delete sleep 1. What this does is has xdotool send the delete command immediately after the first keypress, but then provides a 1 second delay for the second keystroke to be sent through. Tested it on my own machine and it made it so that a single keypress wouldn't get sent through, but a quick double-press would.

If you need an inexpensive keyboard to get you through until you can get a new good quality one, thrift stores usually have large stocks of old (but clean) USB office keyboards that can tie you over for $3-5, and you would have it immediately. Nothing flashy, but comfortable enough for typing and gaming so long as you aren't pressing more than 5 keys at once.

  • Unfortunately it's totally random. Sometimes it's fine and sometimes I get two h. Thanks for mentioning xdotool though, I didn't know about that tool. The real issue is that I actually like this keyboard but it just breaks down every two years. Trying to justify keeping it. Nov 4, 2018 at 19:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.