Skip to content

wscons: Fix repeat key handling for multiple keys - #20

Open
uint23 wants to merge 1 commit into
sizeofvoid:libopeninputfrom
uint23:KeyRepeatFix
Open

wscons: Fix repeat key handling for multiple keys#20
uint23 wants to merge 1 commit into
sizeofvoid:libopeninputfrom
uint23:KeyRepeatFix

Conversation

@uint23

@uint23 uint23 commented Aug 13, 2026

Copy link
Copy Markdown

Using a single old_value for repeat suppression fails if several keys are held; releasing one clears the repeat state for all of the keys so the next repeat from another held key is reported as a new press.

To fix, track key state for every key instead


I encountered this issue when I was just using vim and pressed multiple keys at once.

A "diagram" to show you what I mean:
K1 and K2 are just 2 different keys.

Event old_value Result
K1 down -1 -> K1 K1 press sent
K2 down K1 -> K2 K2 press sent
K1 up K2 -> -1 K1 release sent
K2 repeat -1 -> K2 K2 press sent again :(
K2 up K2 -> -1 K2 release sent

The key_down array could also be compressed by using a bitmap instead of storing 700 or so bytes for KEY_CNT

Using a single old_value for repeat suppression fails if several keys
are held; releasing one clears the repeat state for _all_ of the keys so
the next repeat from another held key is reported as a new press.

To fix, track key state for every key instead
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant