From ec2e05e3a3e247180d03eba93c3efe5cb3e00545 Mon Sep 17 00:00:00 2001 From: chrg6 Date: Wed, 11 Nov 2026 17:26:27 -0500 Subject: [PATCH] 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 --- docs/controls.md | 2 +- runtime/gfx_window_sdl.c | 4 +++- runtime/gfx_window_win.c | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/controls.md b/docs/controls.md index 12747f89..1323c9a2 100644 --- a/docs/controls.md +++ b/docs/controls.md @@ -90,7 +90,7 @@ The game's *Swap Jump Controls* option trades B and X (jump on B, put away on X) |---|---|---| | F1 or Esc | Minus and Plus together | open or close the settings menu; the game gets no input while it is open | | F10 | L3 + R3 (both stick clicks) | performance overlay: off, frame rate, full panel | -| F11 | | borderless fullscreen on or off, saved to `nx2navi.ini` | +| F11 | | borderless fullscreen on or off, saved to `nx2navi.ini`; not with Ctrl, Shift or Alt held, which overlays and capture tools use | The window opens on the monitor `NX2NAVI_MONITOR` (`monitor` in `nx2navi.ini`) names, and F11 fullscreen covers the monitor the window is on. `nx2navi.exe --list-monitors` prints each monitor's index, name (on Windows its device name too), desktop rectangle, primary flag and DPI without game files; `nx2navi.exe --monitor ` sets `NX2NAVI_MONITOR` for one run and wins over the file. The value is `auto` (default), `primary`, an index from the list (counting from 1), or part of a monitor name (on Windows also a device name such as `display3`; on Linux the name carries the connector, such as `dp-2`); when nothing matches, the log lists the monitors and the window is placed as with `auto`. On Wayland a window cannot place itself: only fullscreen (`fullscreen = 1`) opens on the chosen monitor, and a windowed window opens where the compositor puts it. diff --git a/runtime/gfx_window_sdl.c b/runtime/gfx_window_sdl.c index 822d17b9..d5d0599a 100644 --- a/runtime/gfx_window_sdl.c +++ b/runtime/gfx_window_sdl.c @@ -186,7 +186,9 @@ static void handle(const SDL_Event *e) { menu_sdl_event(e); switch (e->type) { case SDL_EVENT_KEY_DOWN: - if (e->key.scancode == SDL_SCANCODE_F11 && !e->key.repeat) { + // not with a modifier held: overlays and capture tools take Ctrl, Shift or Alt+F11 for their own + if (e->key.scancode == SDL_SCANCODE_F11 && !e->key.repeat && + !(e->key.mod & (SDL_KMOD_CTRL | SDL_KMOD_SHIFT | SDL_KMOD_ALT | SDL_KMOD_GUI))) { set_fullscreen(!is_fullscreen()); cfg_set("NX2NAVI_FULLSCREEN", is_fullscreen() ? "1" : "0"); // the menu shows it; the next start keeps it cfg_save(); diff --git a/runtime/gfx_window_win.c b/runtime/gfx_window_win.c index b5b7ae18..618e949a 100644 --- a/runtime/gfx_window_win.c +++ b/runtime/gfx_window_win.c @@ -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);