Skip to content

Windows: Alt+Enter toggles fullscreen, as on Linux - #405

Merged
NotRexed merged 2 commits into
NotRexed:mainfrom
Wpaif:feat/alt-enter-fullscreen
Nov 8, 2026
Merged

NotRexed merged 2 commits into
NotRexed:mainfrom
Wpaif:feat/alt-enter-fullscreen

Conversation

@Wpaif

@Wpaif Wpaif commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Closes #390

What

  • Windows (host/display.c): Alt+Enter now toggles the borderless fullscreen, the same setting as F11 and the Insert menu's Fullscreen row. It arrives as WM_SYSKEYDOWN and used to go straight to DefWindowProc. Other Alt keys (Alt+F4 among them) still reach Windows, a held key toggles once (repeat bit), and Alt+Enter's WM_SYSCHAR is taken so Windows does not beep.
  • Both platforms (host/nn_hid.c): Enter is mapped to Plus, so Alt+Enter also pressed Plus (it opened the pause menu while going fullscreen; Linux's display_sdl.c already had Alt+Enter and showed this). Enter held with Alt is no longer Plus. The rule is a small helper, kmap_down.
  • Test (tests/test_alt_enter.py): game-free, in the source-regressions workflow. It compiles kmap_down alone against fake key states, and checks both window procedures for the Alt+Enter toggle (and, on Windows, for Alt+F4 passing on and the beep being taken).

Testing

  • python -I -B tests/test_alt_enter.py passes, and fails when either the Alt rule or the Alt+F4 pass-through is removed.
  • host/nn_hid.c compiles on Linux (clang, -fsyntax-only).
  • Not built or run on Windows: I only have Linux. The display.c change is small, but a Windows build and a quick Alt+Enter / Alt+F4 check by someone on Windows would be appreciated.

🤖 Generated with Claude Code

Wpaif and others added 2 commits November 7, 2026 21:05
The window procedure only handled F11; Alt+Enter arrives as WM_SYSKEYDOWN
and went to DefWindowProc. It now toggles the borderless fullscreen (other
Alt keys such as Alt+F4 still reach Windows), and its WM_SYSCHAR no longer
beeps. Enter held with Alt no longer also presses Plus (both platforms).

Closes NotRexed#390

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ows)

The keyboard map's Alt+Enter rule moves to nn_hid.c's kmap_down, which
tests/test_alt_enter.py compiles alone against fake key states. It also
checks that both window procedures toggle on Alt+Enter, and that the
Windows one passes other Alt keys on and takes the WM_SYSCHAR beep.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Wpaif
Wpaif force-pushed the feat/alt-enter-fullscreen branch from ff67966 to 347a899 Compare November 8, 2026 00:09
@NotRexed
NotRexed merged commit 6057e79 into NotRexed:main Nov 8, 2026
3 checks passed
@Wpaif
Wpaif deleted the feat/alt-enter-fullscreen branch November 8, 2026 00:22
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.

Alt+Enter to toggle borderless window full screen mode

2 participants