Suppress global hotkeys while a text field is focused

The save-dialog name field is a focused TMP_InputField, but global discrete
hotkeys kept reading the keyboard every frame, so typing a name like
"Checkers" cycled the pose (C) and shut the server down (K). Add a shared
TypingGuard.IsTyping check (focused TMP/legacy InputField) and short-circuit
the global handlers on it: pose cycle, network dev keys, mode switch, and
paint undo/redo. Movement was already gated out via ControlEnabled.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
adminandClaude Opus 4.8 committed 2026-06-30 19:53:26 +02:00
1 parent b951556f35
commit 5965f7199a
6 files changed
+36

No files matched your search

+1
View File
@@ -38,6 +38,7 @@ public class NetworkBootstrap : MonoBehaviour
private void Update()
{
if (!enableHotkeys) return;
if (TypingGuard.IsTyping) return; // don't fire H/C/J/K while typing in a text field
#if ENABLE_INPUT_SYSTEM
var kb = Keyboard.current;
if (kb == null || _net == null) return;