libsdl-org / sdl12-compat

An SDL-1.2 compatibility layer that uses SDL 2.0 behind the scenes.
Other
193 stars 40 forks source link

crrcsim/X11: very fast autorepeat #251

Closed smcv closed 1 year ago

smcv commented 1 year ago

Prerequisites:

To reproduce:

Press Escape to open a menu. Hold down Escape for a second or so.

Expected result: pressing Esc briefly opens menu. Holding Esc cycles between menu and no menu a few times per second.

Actual result: pressing Esc very briefly opens menu, but a typical keypress (at least for me) will be long enough to open it and then close it again - I have to try quite hard to press it briefly enough to get the menu. Holding Esc cycles between menu and no menu rather quickly.

icculus commented 1 year ago

So this happens for a few reasons:

icculus commented 1 year ago

sets a flag that says to actually deal with it on the next iteration of SDL_PumpEvents

(Actually, it just sets the timestamp to "now" at this point, which is treated as a starting point, not the event timeout, so what 1.2 is actually doing is waiting the delay time plus one interval, not waiting the delay and then handling it in the next PumpEvents.)

smcv commented 1 year ago

Confirmed fixed by 67f8b3a, 1.2.58 + 29 commits