mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-10-22 23:38:14 +00:00
[client] app: delay showing the escape help for 250ms
This change prevents the help text being shown unless the escape key has been held for a minimum of 250ms (reduced from 500ms).
This commit is contained in:
@@ -196,7 +196,6 @@ void app_handleKeyPress(int sc)
|
||||
g_state.escapeActive = true;
|
||||
g_state.escapeTime = microtime();
|
||||
g_state.escapeAction = -1;
|
||||
app_showHelp(true);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -234,7 +233,7 @@ void app_handleKeyRelease(int sc)
|
||||
{
|
||||
if (g_state.escapeAction == -1)
|
||||
{
|
||||
if (microtime() - g_state.escapeTime < 500000 && g_params.useSpiceInput)
|
||||
if (!g_state.escapeHelp && g_params.useSpiceInput)
|
||||
core_setGrab(!g_cursor.grab);
|
||||
}
|
||||
else
|
||||
@@ -248,10 +247,7 @@ void app_handleKeyRelease(int sc)
|
||||
}
|
||||
|
||||
if (sc == g_params.escapeKey)
|
||||
{
|
||||
g_state.escapeActive = false;
|
||||
app_showHelp(false);
|
||||
}
|
||||
}
|
||||
|
||||
if (!core_inputEnabled())
|
||||
@@ -386,6 +382,26 @@ void app_handleCloseEvent(void)
|
||||
g_state.state = APP_STATE_SHUTDOWN;
|
||||
}
|
||||
|
||||
void app_handleRenderEvent(const uint64_t timeUs)
|
||||
{
|
||||
if (!g_state.escapeActive)
|
||||
{
|
||||
if (g_state.escapeHelp)
|
||||
{
|
||||
g_state.escapeHelp = false;
|
||||
app_showHelp(false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!g_state.escapeHelp && timeUs - g_state.escapeTime > 200000)
|
||||
{
|
||||
g_state.escapeHelp = true;
|
||||
app_showHelp(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void app_setFullscreen(bool fs)
|
||||
{
|
||||
g_state.ds->setFullscreen(fs);
|
||||
|
Reference in New Issue
Block a user