fix(chat): suppress hotkeys while UI captures keyboard

This commit is contained in:
Kelsi 2026-03-14 04:36:25 -07:00
parent 94e5855d53
commit 5be80a9cc6
2 changed files with 4 additions and 2 deletions

View file

@ -47,7 +47,9 @@ bool KeybindingManager::isActionPressed(Action action, bool repeat) {
// When typing in a text field (e.g. chat input), never treat A-Z or 0-9 as shortcuts.
const ImGuiIO& io = ImGui::GetIO();
if (io.WantTextInput) {
// Note: WantTextInput may not be set until the text widget is processed later in the
// frame, but WantCaptureKeyboard remains true while an ImGui widget is active.
if (io.WantTextInput || io.WantCaptureKeyboard) {
if ((key >= ImGuiKey_A && key <= ImGuiKey_Z) ||
(key >= ImGuiKey_0 && key <= ImGuiKey_9)) {
return false;