mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-30 01:25:51 +00:00
Qt: Don't pass key input to controllers/hotkeys when ImGui has focus
This commit is contained in:
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;
|
const u32 masked_key = static_cast<u32>(key) & IMGUI_KEY_MASK;
|
||||||
if (masked_key < countof(ImGuiIO::KeysDown))
|
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);
|
HandleHostKeyEvent(key & ~Qt::KeyboardModifierMask, key & Qt::KeyboardModifierMask, pressed);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue