Leave F11 to overlays when Ctrl, Shift or Alt is held with it.

F11 switched fullscreen whatever modifier was held, so an overlay or capture tool's Ctrl+F11 or Shift+F11 shortcut also
switched the game's window. The Win32 window now ignores F11 with Ctrl or Shift held (Alt+F11 already arrives as a
system key it does not handle), and the SDL window with any modifier. docs/controls.md says so.

Checked: the runtime compiles; gfx_window_sdl.c passes a syntax check against the SDL3 headers. Not run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-11 17:26:27 -05:00
parent f39e5930d1
commit ec2e05e3a3
3 changed files with 7 additions and 3 deletions

View File

@@ -491,7 +491,9 @@ static LRESULT CALLBACK wnd_proc(HWND h, UINT m, WPARAM w, LPARAM l) {
if (menu_window_msg(h, m, w, l, &input_res)) return input_res;
switch (m) {
case WM_KEYDOWN:
if (w == VK_F11 && !(l & (1 << 30))) { // bit 30: auto-repeat
// bit 30: auto-repeat. Not with Ctrl or Shift held: overlays and capture tools take such F11 shortcuts for their
// own (Alt+F11 comes as WM_SYSKEYDOWN)
if (w == VK_F11 && !(l & (1 << 30)) && GetKeyState(VK_CONTROL) >= 0 && GetKeyState(VK_SHIFT) >= 0) {
input_cursor_suspend(1);
toggle_fullscreen(h);
input_cursor_suspend(0);