ludic/changes/windowed-quit-keys.md
Orkuncakilkaya bdf1a97550
All checks were successful
bootstrap / cfree-fixpoint (push) Successful in 22s
ci / build-and-test (push) Successful in 2m20s
commit-lint / conventional-commits (push) Successful in 5s
fix(windowed): #88 don't force-quit windowed games on Esc or 'q'
cocoa.ll win_poll hard-coded Escape (keycode 53) and 'q' as quit (W_running=0),
so a shipped windowed game died the instant a player pressed Esc (pause) or
typed 'q'. Remove the dev-loop quit keys for windowed builds: Escape is
delivered as key 27 and 'q' is an ordinary key, consistently across the
single per-frame @W_key and the #50 held-key set (ev_keyval maps Esc->27, not
'q'). A windowed game owns Esc/pause and quits via quit() or the window close
button (still ends the run). The headless rt_poll keeps its own 'q'=quit for
scripted golden tests, so nothing headless changes. Also stops forwarding
consumed key events to -sendEvent:, which rang AppKit's system beep per key.

Windowed-only behavior (not exercised by the headless suite); verified a
windowed build links and assembles cleanly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-02 07:23:09 +03:00

998 B

bump: patch type: fix Windowed games no longer force-quit on Esc or 'q' (#88). The macOS platform layer (runtime/native/cocoa.ll win_poll) used to hard-code Escape (keycode 53) and the character 'q' as quit — storing W_running = 0 so a shipped windowed game died the instant a player pressed Esc (a universal pause key) or typed 'q'. Those dev-loop conveniences are removed for windowed builds: Escape is delivered to the game as key 27 and 'q' is an ordinary key, consistently across both the single per-frame key (@W_key) and the #50 held-key set (ev_keyval now maps Escape→27, not 'q'). A windowed game now owns Esc/pause and shuts down via quit() or the window close button (which still ends the run). The headless test driver (rt_poll in core.ludic) keeps its own 'q' = quit for scripted golden runs, so nothing headless changes. Also stops forwarding consumed key events to -sendEvent:, which was triggering AppKit's system "funk" beep on every keystroke.