Qt: Don't pass key input to controllers/hotkeys when ImGui has focus

pull/1742/head
Connor McLaughlin 4 years ago
parent 767343ca22
commit c3d2999d78

@ -379,7 +379,12 @@ void QtHostInterface::onDisplayWindowKeyEvent(int key, bool pressed)
const u32 masked_key = static_cast<u32>(key) & IMGUI_KEY_MASK;
if (masked_key < countof(ImGuiIO::KeysDown))
ImGui::GetIO().KeysDown[masked_key] = pressed;
{
ImGuiIO& io = ImGui::GetIO();
io.KeysDown[masked_key] = pressed;
if (io.WantCaptureKeyboard)
return;
}
HandleHostKeyEvent(key & ~Qt::KeyboardModifierMask, key & Qt::KeyboardModifierMask, pressed);
}

Loading…
Cancel
Save