diff --git a/client/src/app.c b/client/src/app.c index 79f640ce..3d540dee 100644 --- a/client/src/app.c +++ b/client/src/app.c @@ -194,6 +194,7 @@ void app_handleKeyPress(int sc) if (sc == g_params.escapeKey && !g_state.escapeActive) { g_state.escapeActive = true; + g_state.escapeTime = microtime(); g_state.escapeAction = -1; app_showHelp(true); return; @@ -233,7 +234,7 @@ void app_handleKeyRelease(int sc) { if (g_state.escapeAction == -1) { - if (g_params.useSpiceInput) + if (microtime() - g_state.escapeTime < 500000 && g_params.useSpiceInput) core_setGrab(!g_cursor.grab); } else diff --git a/client/src/main.h b/client/src/main.h index f427436f..382dc643 100644 --- a/client/src/main.h +++ b/client/src/main.h @@ -49,6 +49,7 @@ struct AppState bool ignoreInput; bool showFPS; bool escapeActive; + uint64_t escapeTime; int escapeAction; KeybindHandle bindings[KEY_MAX]; const char * keyDescription[KEY_MAX];