[client] imgui: implement keyboard input forwarding and capture

This commit is contained in:
Quantum 2021-07-26 17:36:23 -04:00 committed by Geoffrey McRae
parent 065d90c3f7
commit 1c58b3a087

View File

@ -288,6 +288,13 @@ void app_handleKeyPress(int sc)
return; return;
} }
if (g_state.overlayInput)
{
g_state.io->KeysDown[sc] = true;
if (g_state.io->WantCaptureKeyboard)
return;
}
if (!core_inputEnabled()) if (!core_inputEnabled())
return; return;
@ -336,6 +343,13 @@ void app_handleKeyRelease(int sc)
if (!core_inputEnabled()) if (!core_inputEnabled())
return; return;
if (g_state.overlayInput)
{
g_state.io->KeysDown[sc] = false;
if (g_state.io->WantCaptureKeyboard)
return;
}
// avoid sending key up events when we didn't send a down // avoid sending key up events when we didn't send a down
if (!g_state.keyDown[sc]) if (!g_state.keyDown[sc])
return; return;