Ubuntu – Can I enable Bounce Keys for certain keys only


On my laptop, I'm having a persistent issue where keystrokes on the space bar are being repeated. Having been through a number of replacements, as well as trying multiple operating systems, I have judged that the issue is a hardware one, not a software one.

Fortunately, I learned that Ubuntu had a feature known as bounce keys, which would allow me to counteract the issue, as repeated keystrokes would be filtered.

However, enabling the solution for all keys sometimes filters keys that I don't want to be filtered. For instance, when I type hello, I often press the two ls in quick succession, however sometimes one of the ls is filtered, which can be quite annoying. I know I'll never need to press the space bar twice in such quick succession, and since I'm only having problems with the space bar, I only want to enable bounce keys on the space bar.

So, is it possible to only enable bounce keys on the space bar?

Best Answer

  • xset - user preference utility for X

    r is to control autorepeat.

    xset -r 10

    will disable autorepeat for the "1" key.

    xset r 10

    will enable autorepeat for the "1" key.

    xset r [keycode]

    in my case keycode for space bar is 65 check for yours with code: xev | grep -A2 --line-buffered '^KeyRelease' | sed -n '/keycode /s/^.*keycode \([0-9]*\).* (.*, \(.*\)).*$/\1 \2/p'

    Still if you need to change speed of keys you can also use rate parameter to it.

    And also add this command to your session start script file.

  • Related Question