From 5b7e2521cc8e8414d9f14a49b582973822432d4a Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 9 Feb 2020 10:20:41 -0800 Subject: [PATCH] Ignore unbind and full-screen key combos on EGLFS --- app/streaming/input.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app/streaming/input.cpp b/app/streaming/input.cpp index 76fce16c..882e2fb4 100644 --- a/app/streaming/input.cpp +++ b/app/streaming/input.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #define VK_0 0x30 #define VK_A 0x41 @@ -228,8 +229,8 @@ void SdlInputHandler::handleKeyEvent(SDL_KeyboardEvent* event) SDL_PushEvent(&event); return; } - // Check for the unbind combo (Ctrl+Alt+Shift+Z) - else if (event->keysym.sym == SDLK_z) { + // Check for the unbind combo (Ctrl+Alt+Shift+Z) unless on EGLFS which has no window manager + else if (event->keysym.sym == SDLK_z && QGuiApplication::platformName() != "eglfs") { SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "Detected mouse capture toggle combo (SDLK)"); @@ -241,7 +242,7 @@ void SdlInputHandler::handleKeyEvent(SDL_KeyboardEvent* event) raiseAllKeys(); return; } - else if (event->keysym.sym == SDLK_x) { + else if (event->keysym.sym == SDLK_x && QGuiApplication::platformName() != "eglfs") { SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "Detected full-screen toggle combo (SDLK)"); Session::s_ActiveSession->toggleFullscreen(); @@ -277,7 +278,7 @@ void SdlInputHandler::handleKeyEvent(SDL_KeyboardEvent* event) return; } // Check for the unbind combo (Ctrl+Alt+Shift+Z) - else if (event->keysym.scancode == SDL_SCANCODE_Z) { + else if (event->keysym.scancode == SDL_SCANCODE_Z && QGuiApplication::platformName() != "eglfs") { SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "Detected mouse capture toggle combo (scancode)"); @@ -289,8 +290,8 @@ void SdlInputHandler::handleKeyEvent(SDL_KeyboardEvent* event) raiseAllKeys(); return; } - // Check for the full-screen combo (Ctrl+Alt+Shift+X) - else if (event->keysym.scancode == SDL_SCANCODE_X) { + // Check for the full-screen combo (Ctrl+Alt+Shift+X) unless on EGLFS which has no window manager + else if (event->keysym.scancode == SDL_SCANCODE_X && QGuiApplication::platformName() != "eglfs") { SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "Detected full-screen toggle combo (scancode)"); Session::s_ActiveSession->toggleFullscreen();