r/Ubuntu • • 8d ago

Occasional Duplicate Keystrokes

I'll be typing along and suddenly I get a duplicate keystroke. This only happens on Ubuntu (I'm dual-booting Windows.) I've tried enabling "Bounce Keys" in the Accessibility settings, which seems to help a bit. However, sometimes the phantom keystroke comes after I've already typed a few letters. (e.g. "aftaer" rather than "aafter") That doesn't get caught by the debounce settings.

What could even be doing this? I don't understand Ubuntu's input architecture well enough to know what the culprit could be. Can anyone shed some light on this? Do you have any ideas on how to fix it? I'm running 26.04.1.

10 Upvotes

17 comments sorted by

5

u/GiggleSamurai 7d ago

To see which layer adds it, install libinput-tools, run "sudo libinput debug-events --show-keycodes" and type until it happens: if the extra letter shows up there as a second KEY_ press, it's coming from the keyboard or its connection, and if it doesn't, it's being added further up (key repeat, IBus or the app).

1

u/worldgnat 2d ago

Interesting, I got a doubled keystroke in the output. So it sounds like you're saying this proves it's a hardware issue? Edit: I sincerely hope that's not the case, because this is a built-in keyboard on a laptop! That would suck.

3

u/Monoyo- 8d ago

does it happen with an external keyboard too, or only the built-in one? if you can reproduce it from a live usb, that might help tell whether it's tied to the current install or follows the hardware.

2

u/Little-Rope-2880 7d ago

Might also be worth checking if the same thing happens in a plain tty session outside the desktop environment

1

u/worldgnat 2d ago

It typed for a while and didn't see it. So maybe it's a desktop environment thing? Interesting.

1

u/worldgnat 2d ago

So far I've only used the internal one (it is, indeed, a laptop) but I'll try to give it a shot with an external keyboard. Interestingly though, I tried switching over to a non-ui TTY and didn't see the issue for a while. So maybe it's a Gnome3 thing? I might try Cinnamon for a bit and see if that does it.

1

u/Monoyo- 13h ago

yeah if it stays gone in a plain tty that points more at the gnome session than the keyboard itself. trying cinnamon for a bit is a good next check

2

u/definitely_verastein 8d ago

fiddled with this exact problem for a week before i realized my bluetooth keyboard had a janky connection that would buffer and then dump two strokes at once, try swapping the connection type and see if it still happens

1

u/Drate_Otin 8d ago

You seem to be assuming it's a laptop.

1

u/Monoyo- 7d ago

ah fair, i shouldn't have assumed a laptop. better question is whether it happens on more than one keyboard, and whether a live usb does the same thing, that would help tell if it's the current install or the machine

2

u/Smugness1917 8d ago

Is it a wireless keyboard? 

1

u/worldgnat 2d ago

Nope. Built-in laptop keyboard.

1

u/illegal_appendix 8d ago

Does it happen in every app or mostly in one, like the browser? If the terminal and the text editor are fine and only Chrome or Discord does it, that points more at the app than the keyboard.

1

u/worldgnat 2d ago

No, it's pretty much everything, unfortunately.

1

u/illegal_appendix 1d ago

Huh, everywhere then. Did it start after an update or right from the install?

1

u/worldgnat 21h ago

Right from the start! It's odd; I don't think I've ever seen this happen before.

1

u/illegal_appendix 27m ago

Weird. Is it every key or mostly the same few letters?