livesplit-core icon indicating copy to clipboard operation
livesplit-core copied to clipboard

Suppress repeating hotkey presses

Open CryZe opened this issue 3 years ago • 4 comments

It seems like on most platforms our hotkeys currently repeat when you keep the key pressed.

  • [ ] Windows (There's no way to differentiate, we probably have to track the pressed, released status ourselves)
  • [x] Linux (Easy to deal with on evdev)
  • [x] macOS (The event has a EventField::KeyboardEventAutorepeat field that we need to take into account)
  • [x] Web (The event has a repeat field that we need to take into account)

CryZe avatar Nov 08 '21 19:11 CryZe

TIL, keyboards themselves actually emit the repeats which somewhat explains why the low level keyboard hook in Windows doesn't track this for us.

It's called the typematic delay and rate and can be controlled by the host: https://wiki.osdev.org/PS/2_Keyboard

CryZe avatar Jan 15 '22 21:01 CryZe

This only applies to PS/2 Keyboards. USB Keyboards don't implement this and leave it entirely up to the OS.

DarkRTA avatar Jan 15 '22 22:01 DarkRTA

Sure, but I assume the low level keyboard hook API is old enough (just like all the other keyboard related stuff) that it's based on PS/2.

CryZe avatar Jan 15 '22 22:01 CryZe

This is pretty important for me considering I use a PS/2 keyboard!

TheTedder avatar Jan 15 '22 22:01 TheTedder