Game: Insert and Shift+Insert close the Insert menu while a text field is edited #3129
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot#3129
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
What happened
While one of the Insert menu's text fields is being typed in (for example Graphics → Custom output size), pressing the keyboard's Insert closes the menu, and Shift+Insert closes the menu instead of pasting. Esc ends the edit and leaves the menu open, as it should.
Seen in the game on main
a98cf28a2(the files below are unchanged up to6318f4056), Windows 10, keyboard.Why
Before the mod API merge (
d984fd704),menu_tickkept Insert for the field while one was edited:The merge moved text fields to the Rust UI and took this line out with the old editing code. Now
press[0]closes the menu atgpu/vk/vk_menu.cpp:1632-1634whatever is focused. The paste itself still works end to end (host/display.c:803Shift+Insert/Ctrl+V →hos_text_paste→vk_ui.cpptake_text→ the field), so only the menu's close is in the way. Nothing in the merge's description or comments says the change was meant.A likely fix
Clear the keyboard's
press[0]whileui_owns_text()(gpu/vk/vk_ui.cpp:539, true while a field has the text), still letting F1, Select + Start and the Controller menu button close the menu (that keeps #3028 fixed), with a case intests/test_menu_keys.pyortests/test_menu_text_field.py.Checked: this looks like a valid bug, and its cause is visible in the code.
With the Insert shortcut enabled, the menu handles Insert as a close request even while a text field owns input. On Windows, Shift+Insert also queues a paste, but the same key press can close the menu. The previous editing-time exemption was removed in the mod API merge. I did not run the game or verify the reported Esc behavior.
For maintainers
Issue #3028's history explicitly describes the mod API merge removing the editing-time Insert exemption and identifies keyboard Insert as a separate interaction. Current main code search shows
ui_owns_text()ingpu/vk/vk_menu.cpptext-taking logic and its definition ingpu/vk/vk_ui.cpp:539; this report supplies the target close logic atgpu/vk/vk_menu.cpp:1632-1634.The likely regression is the removal of the editing-time exemption in
d984fd704. Preserve the controller close paths when handling keyboard Insert; both currently sharepress[0]. The paste path is conditional on the keyboard input policy.Seen in the code:
keys[0]; lines 1457–1469 record its press when the shortcut is enabled.press[0]toggles the menu without checking text ownership.ui_owns_text()reports the UI text-ownership flag; lines 701–710 take text for the field.press[0], so they must be distinguished from keyboard Insert.d984fd704removed the old editing-time Insert exemption at this point, as shown bygit show; there are no changes to the three relevant files betweena98cf28a2and HEAD.Possibly related, for context:
Automated triage by BeanBot (gpt-6-luna). Nothing was run; a maintainer decides.