feat(menu): Esc can open the Insert menu (Menu shortcut "Insert, F1 or Esc") #1998

Merged
pmwork-personal merged 3 commits from feat/menu-esc into main 2026-11-11 00:30:19 +00:00
pmwork-personal commented 2026-11-10 23:10:20 +00:00 (Migrated from github.com)

On PC, Esc is the key that opens a game's menu, but Hookshot's Insert menu opens only on Insert or F1 — and many laptops and
compact keyboards have no Insert key. This adds Esc as an opt-in choice of the Menu shortcut row.

What changed

  • Controls → Menu shortcut gets a third choice, Insert, F1 or Esc (menu_shortcut=2). On a closed menu Esc opens it; while
    it is open Esc still goes back a page or closes it, as before. The default stays Insert or F1.
  • Only the keyboard's Esc opens it (the gamepad's back button counts as Esc only while the menu is open), and no control can be
    bound to Esc, so nothing in play changes.
  • The window lets the captured mouse go on Esc, before the menu sees the key, so the menu forgot that the mouse was captured
    and the camera lost it after the menu closed. host/display.c and host/posix/display_sdl.c now note that Esc let a
    capture go (esc_had_capture), and closing the menu brings the capture back without a click.
  • Tests: test_menu_keys.py covers the three shortcut choices and Esc opening a closed menu without also going back a page in
    the same press; display_pointer_test.cpp and screensaver_test.c declare esc_had_capture beside the window statics they
    stand in for.

Testing

  • Windows 11, RTX 5090, NVIDIA 621.14, 5120x2160 borderless. In game (Kokiri Forest): Esc opens the menu and closes it again;
    after it closes, the camera has the mouse back without a click; Insert and F1 behave as before.
  • tests/run_all.py on Windows: 322 of 324 pass; test_precompile_compute_guard and test_recorder_sync fail the same on
    untouched main here.
  • In-game run on a build of main fc375e9 with this change; this branch is the same commit rebased onto 9447e1d.

Not tested: Linux (the SDL path builds the same note, display_sdl.c, but was not run), a gamepad-only setup, AMD/Intel.

Screenshots
Controls tab: Menu shortcut set to "Insert, F1 or Esc"

The Controls tab with Menu shortcut on "Insert, F1 or Esc" (5120x2160, frame generation 2x on: 110 fps shown, 55 of the game's).

🤖 Generated with Claude Code

On PC, Esc is the key that opens a game's menu, but Hookshot's Insert menu opens only on Insert or F1 — and many laptops and compact keyboards have no Insert key. This adds Esc as an opt-in choice of the Menu shortcut row. **What changed** - Controls → Menu shortcut gets a third choice, **Insert, F1 or Esc** (`menu_shortcut=2`). On a closed menu Esc opens it; while it is open Esc still goes back a page or closes it, as before. The default stays **Insert or F1**. - Only the keyboard's Esc opens it (the gamepad's back button counts as Esc only while the menu is open), and no control can be bound to Esc, so nothing in play changes. - The window lets the captured mouse go on Esc, before the menu sees the key, so the menu forgot that the mouse was captured and the camera lost it after the menu closed. `host/display.c` and `host/posix/display_sdl.c` now note that Esc let a capture go (`esc_had_capture`), and closing the menu brings the capture back without a click. - Tests: `test_menu_keys.py` covers the three shortcut choices and Esc opening a closed menu without also going back a page in the same press; `display_pointer_test.cpp` and `screensaver_test.c` declare `esc_had_capture` beside the window statics they stand in for. **Testing** - Windows 11, RTX 5090, NVIDIA 621.14, 5120x2160 borderless. In game (Kokiri Forest): Esc opens the menu and closes it again; after it closes, the camera has the mouse back without a click; Insert and F1 behave as before. - `tests/run_all.py` on Windows: 322 of 324 pass; `test_precompile_compute_guard` and `test_recorder_sync` fail the same on untouched main here. - In-game run on a build of main `fc375e9` with this change; this branch is the same commit rebased onto `9447e1d`. **Not tested**: Linux (the SDL path builds the same note, `display_sdl.c`, but was not run), a gamepad-only setup, AMD/Intel. **Screenshots** ![Controls tab: Menu shortcut set to "Insert, F1 or Esc"](https://raw.githubusercontent.com/pmwork-personal/Hookshot-pr/pr-screenshots/esc/controls-menu-shortcut-esc.webp) _The Controls tab with Menu shortcut on "Insert, F1 or Esc" (5120x2160, frame generation 2x on: 110 fps shown, 55 of the game's)._ 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Commenting is not possible because the repository is archived.
No description provided.