Windowed platform layer hard-codes quit keys ('q' and Esc force-quit the window) #88
Labels
No labels
area:ci
area:docs
area:input
area:net
area:rendering
area:repo
area:stdlib
area:tooling
area:types
cleanup
dx
priority:high
priority:low
priority:medium
proposal
status:in-progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: workshopsoft/ludic#88
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
runtime/native/cocoa.llwin_polltreats Escape (keycode 53) and the character 'q' as quit: it storesW_running = 0and the game exits immediately. That is a dev-loop convenience, but it means any shipped windowed game dies the moment a player presses Esc (a universal pause key) or types 'q'.Applied locally (2026-09-02): Escape is now delivered as key 27 and left to the game; 'q' is an ordinary key. The headless driver (
rt_pollin core.ludic) keeps its own 'q' = quit, which is fine for scripted tests.Proposal: make platform quit keys opt-in (e.g. a
--dev-keysbuild flag orWindow.dev_quit_keys(true)), default OFF for windowed builds. Games should own Esc/pause and quit viaquit()or the window close button.Fixed in
bdf1a97.win_pollno longer treats Escape (keycode 53) or 'q' as quit for windowed builds:W_running = 0.@W_keyand the #50 held-key set.ev_keyval(which feedswin_held_bit) mapped Escape→113('q'); it now maps Escape→27, soInput.key_down/held state matches@W_key(previously holding Esc would have set the 'q' bit).quit()or the window close button (which still ends the run atclosed:).The headless driver (
rt_pollin core.ludic) keeps its own'q'= quit for scripted/golden tests, so nothing headless changes. Also stopped forwarding consumed key events to-sendEvent:(it was ringing AppKit's system 'funk' beep on every keystroke).On the opt-in dev-quit-keys proposal: I removed the quit keys by default (which is what 'default OFF for windowed builds' asks for) rather than gating them behind a flag — Cmd-Q, the window close button, and
quit()already cover shutdown, and the headless'q'covers scripted dev runs, so a windowed dev-quit-key flag would add compiler plumbing for little gain. Happy to add--dev-quit-keys/Window.dev_quit_keys()as a follow-up if you want the convenience back. This is windowed-only behavior (not in the headless golden suite); verified a windowed build assembles + links cleanly.