Method PressEscapeAndWait
- Namespace
- GrindFest
- Assembly
- GrindFest.dll
PressEscapeAndWait(float)
ESC the way a player presses it: dispatch the key, then wait a moment before the caller presses again. The gap is part of simulating a player, not padding.
OneJS re-registers its ESC handler in a deferred effect, so the new handler only exists after the frame that applied the previous state change. A second ESC sent in that same frame still reaches the OLD handler, which repeats what it just did - the press looks ignored even though the app is fine. A player cannot press twice inside one frame (~16 ms); a test can, so it has to wait like one.
This cannot mask the bug these tests guard: a handler that is never re-armed because the app is broken stays broken however long the gap is.
protected IEnumerator PressEscapeAndWait(float gap = 0.25)
Parameters
gapfloat