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

@@ -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();