livesplit-core
livesplit-core copied to clipboard
Suppress repeating hotkey presses
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)
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
This only applies to PS/2 Keyboards. USB Keyboards don't implement this and leave it entirely up to the OS.
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.
This is pretty important for me considering I use a PS/2 keyboard!