mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-12-23 22:31:46 +00:00
[client] imgui: respect WantCaptureKeyboard
If the overlay is active and imgui has set WantCaptureKeyboard we should ignore the escape key sequences.
This commit is contained in:
parent
7eb00bd24c
commit
8898496eba
1 changed files with 13 additions and 10 deletions
|
@ -280,18 +280,21 @@ void app_handleWheelMotion(double motion)
|
||||||
|
|
||||||
void app_handleKeyPress(int sc)
|
void app_handleKeyPress(int sc)
|
||||||
{
|
{
|
||||||
if (sc == g_params.escapeKey && !g_state.escapeActive)
|
if (!g_state.overlayInput || !g_state.io->WantCaptureKeyboard)
|
||||||
{
|
{
|
||||||
g_state.escapeActive = true;
|
if (sc == g_params.escapeKey && !g_state.escapeActive)
|
||||||
g_state.escapeTime = microtime();
|
{
|
||||||
g_state.escapeAction = -1;
|
g_state.escapeActive = true;
|
||||||
return;
|
g_state.escapeTime = microtime();
|
||||||
}
|
g_state.escapeAction = -1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (g_state.escapeActive)
|
if (g_state.escapeActive)
|
||||||
{
|
{
|
||||||
g_state.escapeAction = sc;
|
g_state.escapeAction = sc;
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_state.overlayInput)
|
if (g_state.overlayInput)
|
||||||
|
|
Loading…
Reference in a new issue