overlay: don't steal keys during native text entry - #5951
Open
Alistair-Afton wants to merge 1 commit into
Open
Alistair-Afton wants to merge 1 commit into
Alistair-Afton wants to merge 1 commit into
Conversation
Overlay widgets consume bound interface keys before the viewscreen sees them, so overlay hotkeys stole letters while a native text field was active (e.g. renaming a building). Skip widget input dispatch entirely when a native text-entry flag is set.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5764. Supersedes DFHack/scripts#1624 (a per-overlay fix limited to the trackstop and machine-toggle overlays).
Overlay widgets consume bound interface keys before the viewscreen's own input handling runs, so overlay hotkeys (e.g. the pressure plate overlay's
x, or the lever mechanism overlay'sg/m) stole typed characters while a native text field was active — most visibly when renaming a building.feed_viewscreen_widgetsnow returns early when any native text-entry flag is set (entering_building_name,building_entering_nickname,unit_overview_entering_*,entering_building_job_filter,entering_gen_work_order_num,entering_wq_number), letting all keys fall through to the native screen. This fixes the bug class centrally rather than guarding each overlay individually, matching the per-overlay pattern already used byorders.skillrestrictions.Verified in-game via a probe widget bound to
CUSTOM_Xondwarfmode: withbuilding_entering_nicknameunset the widget consumes the key; with the flag set the feed returns unhandled and the widget never sees it.Test plan
feed_viewscreen_widgetswith rename flag toggled