mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-10-15 20:08:17 +00:00
[client] spice: add option to ignore the windows key
If active this will prevent the client from sending keyboard events for the windows key. The idea is to allow people to keep the windows key bound to their WMs default action without causing the Windows start menu to open
This commit is contained in:
@@ -1213,7 +1213,7 @@ int eventFilter(void * userdata, SDL_Event * event)
|
||||
case SDL_KEYDOWN:
|
||||
{
|
||||
SDL_Scancode sc = event->key.keysym.scancode;
|
||||
if (sc == params.escapeKey)
|
||||
if (sc == params.escapeKey && !g_state.escapeActive)
|
||||
{
|
||||
g_state.escapeActive = true;
|
||||
g_state.escapeAction = -1;
|
||||
@@ -1229,6 +1229,11 @@ int eventFilter(void * userdata, SDL_Event * event)
|
||||
if (g_state.ignoreInput || !params.useSpiceInput)
|
||||
break;
|
||||
|
||||
if (params.ignoreWindowsKeys &&
|
||||
(sc == SDL_SCANCODE_LGUI || sc == SDL_SCANCODE_RGUI))
|
||||
break;
|
||||
|
||||
|
||||
uint32_t scancode = mapScancode(sc);
|
||||
if (scancode == 0)
|
||||
break;
|
||||
@@ -1299,7 +1304,10 @@ int eventFilter(void * userdata, SDL_Event * event)
|
||||
{
|
||||
KeybindHandle handle = g_state.bindings[sc];
|
||||
if (handle)
|
||||
{
|
||||
handle->callback(sc, handle->opaque);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (sc == params.escapeKey)
|
||||
@@ -1313,6 +1321,10 @@ int eventFilter(void * userdata, SDL_Event * event)
|
||||
if (!g_state.keyDown[sc])
|
||||
break;
|
||||
|
||||
if (params.ignoreWindowsKeys &&
|
||||
(sc == SDL_SCANCODE_LGUI || sc == SDL_SCANCODE_RGUI))
|
||||
break;
|
||||
|
||||
uint32_t scancode = mapScancode(sc);
|
||||
if (scancode == 0)
|
||||
break;
|
||||
|
Reference in New Issue
Block a user