Skip to content

overlay: don't steal keys during native text entry - #5951

Open
Alistair-Afton wants to merge 1 commit into
DFHack:developfrom
Alistair-Afton:overlay-native-text-entry
Open

Alistair-Afton wants to merge 1 commit into
DFHack:developfrom
Alistair-Afton:overlay-native-text-entry

Conversation

@Alistair-Afton

@Alistair-Afton Alistair-Afton commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

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's g/m) stole typed characters while a native text field was active — most visibly when renaming a building.

feed_viewscreen_widgets now 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 by orders.skillrestrictions.

Verified in-game via a probe widget bound to CUSTOM_X on dwarfmode: with building_entering_nickname unset the widget consumes the key; with the flag set the feed returns unhandled and the widget never sees it.

Test plan

  • Probe overlay widget verified via feed_viewscreen_widgets with rename flag toggled
  • Rename a pressure plate / lever / workshop in-game and confirm bound letters reach the text field

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: trackstop.pressureplate overlay steals input from building renaming

1 participant