feat(menu): Esc opens the Insert menu by default (Menu shortcut "Insert, F1 or Esc") #2197
No reviewers
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
No milestone
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Hookshot!2197
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/menu-esc-default"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
On PC, Esc is the key that opens a game's menu, and players expect it: after #1998 added Esc as an opt-in Menu shortcut
choice, null asked in #dev-work why Esc closes the Insert menu but doesn't open it. This makes that choice the default,
for existing players too.
What changed
gpu/vk/vk_menu.h:menu_shortcutdefaults to 2, Insert, F1 or Esc. On a closed menu Esc opens it; while it isopen Esc still goes back a page or closes it. F1 always works, and the row still offers Insert or F1 and F1 only.
options_version5). null is an existing player, and so is nearly everyone who wouldnotice this. The menu writes every row on save, so the old default,
menu_shortcut=0(Insert or F1), is in everyoptions file whether the player chose it or not. A default that only new installs get wouldn't reach them. Like Game
speed (version 2) and Descriptor reuse (version 4),
menu_initnow moves an older file's 0 to 2. Only 0 moves:save()writesoptions_version=5, so a player who picks Insert or F1 from now on keeps it.lands second takes 6; it's a one-line renumber plus its test, and I'll do it here if this one is second.
closes (
esc_had_capture, #1998 and #2035, unchanged here). No game control can be bound to Esc (bindable_keys,host/nn_hid.cdefaults), and a gamepad's back button counts as Esc only while the menu is open.readme.md: the menu keys paragraph (with the move of older options), and the Menu shortcut row's values and defaultin the options table.
tests/test_menu_keys.py:menu_tick's Esc block with the realOptionsfromvk_menu.hand the row's names(
tx_menu_shortcut). Out of the box the shortcut is "Insert, F1 or Esc", and Esc opens a closed menu without the samepress going back a page. With Insert or F1 or F1 only, Esc leaves it closed. Both polled and queued presses.
menu_init's reading ofhookshot_options.iniand loads real files through it. From beforeversion 5 (versions 2 to 4, or no
options_versionline): 0 loads as 2, 1 and 2 stay, no line gets 2. At theversion
save()writes now, read fromsave()itself: 0, 1 and 2 all stay.int menu_shortcut = 0;).Testing
tests/test_menu_keys.pypasses, and each part fails without its change:loaded_as(0, old) == 2fails;save()left writingoptions_version=4:loaded_as(mode, 4) == modefails (a choice made after the change wouldbe moved again).
test_menu_env_on,test_audio_output_menu,test_framegen_preset,test_rumble_menu,test_vsync_row,test_audio_volume,test_menu_size,test_stick_dead_zone,test_menu_hit,test_menu_restart,test_menu_restart_slots,test_gpu_choice,test_display_pointer,test_screensaver.tests/run_all.pyon Windows (llvm-mingw), on maine19d969with this change: 341 passed, 2 failed, 30 skipped.The two failures fail the same way on untouched main on this PC:
test_precompile_compute_guard(this toolchain has nowindows.hfor its fixture) andtest_recorder_sync(its exit case; itsvk_menu.cppsource checks pass).Not tested: in game (no build of this branch was run; the Esc behaviour itself is #1998's, which was played),
Linux.
Screenshots: nothing new on screen. The row and its values are #1998's; it now starts on "Insert, F1 or Esc".
🤖 Generated with Claude Code
I think someone is trying to get normal mouse/keyboard working, so Esc should probably open the in-game menu in the future
Heads-up: this conflicts with main now. Could you rebase onto main and resolve the conflicts? Thanks!
Merged main in to clear the conflict with #2181 (no force-push). The FPS counter rows from #2181 are kept as they are, and the Menu shortcut default is 2 again on top.
tests/run_all.pyon Windows: 342 passed, 30 skipped, 2 failed (test_recorder_syncandtest_precompile_compute_guard, which also fail on untouched main here).On Esc and keyboard play: agreed. Once the game takes keyboard and mouse input, Esc should open the game's own menu. Then the default can move again with the next
options_version, the same way this PR moves it. Until then Esc does nothing in game, so opening the Insert menu with it is what players asked for.(Still open: #2110 also writes
options_version5. Whichever lands second takes 6.)This looks good. The migration is the right shape: only a pre-version-5
menu_shortcut=0moves to 2 (gpu/vk/vk_menu.cpp:2956), F1 only is left alone, andsave()writesoptions_version=5(gpu/vk/vk_menu.cpp:1374), so a player who picks Insert or F1 again keeps it. I checked the places where a new default for Esc could leak into play:mineinmenu_tick), so Esc pressed in another app doesn't open the menu.press[5]from the pointer is read only underopen_now, andpad_backlikewise), so a right click or B in game doesn't open it.esc_opensclearspress[5], so the press that opens the menu doesn't also go back a page.The rewritten
tests/test_menu_keys.pyis stronger than the text check it replaces: it compiles the real Esc block andmenu_init's reader against real files. I ran it at the PR's head, together withtest_menu_env_on,test_menu_restart,test_menu_restart_slotsandtest_display_pointer: all pass. The branch merges cleanly onto current main (still atoptions_version=4). The two red CI jobs are unrelated:test_native_astc_texture_count.pyon Windows, fixed on main by #2397, and a Launchpad PPA timeout inappimage. A re-run or a merge of main should clear them.One thing to keep in mind rather than change:
options_version5. Whichever merges second has to renumber both itssave()line and itsversion < Ncheck (and its test's expected version), or the second migration will never run for files the first one already rewrote. You've already said you'll take 6 if this one lands second; just flagging it so the maintainer merging the second one checks it.Merged main: the
vk_menu.hconflict with #2378'scompact_menu_keyis cleared; Menu shortcut stays "Insert, F1 or Esc" by default, with theoptions_version=5move of older files.The conflict is one line (
vk_menu.h, main's newcompact_menu_key). After resolving it, the rewrittentests/test_menu_keys.pydoesn't compile against main, becausemenu_tick/menu_initnow usetune_mode,tune_down,has_memory_budgetandhas_vram_budget, which the fixture doesn't stub. The red checks are main's old ASTC failure and a PPA timeout.options_version=5is also used by #2119 and #2110. Suggested order: this one, then #2177, then #2119 rebased, with later ones renumbering theirsave()line,version < Ncheck and tests.github-sync referenced this pull request2026-11-12 06:22:54 +00:00