mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-06-18 14:40:56 +00:00
Ignore unbind and full-screen key combos on EGLFS
This commit is contained in:
@@ -7,6 +7,7 @@
|
|||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
#include <QtMath>
|
#include <QtMath>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
#include <QGuiApplication>
|
||||||
|
|
||||||
#define VK_0 0x30
|
#define VK_0 0x30
|
||||||
#define VK_A 0x41
|
#define VK_A 0x41
|
||||||
@@ -228,8 +229,8 @@ void SdlInputHandler::handleKeyEvent(SDL_KeyboardEvent* event)
|
|||||||
SDL_PushEvent(&event);
|
SDL_PushEvent(&event);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Check for the unbind combo (Ctrl+Alt+Shift+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) {
|
else if (event->keysym.sym == SDLK_z && QGuiApplication::platformName() != "eglfs") {
|
||||||
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
|
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
"Detected mouse capture toggle combo (SDLK)");
|
"Detected mouse capture toggle combo (SDLK)");
|
||||||
|
|
||||||
@@ -241,7 +242,7 @@ void SdlInputHandler::handleKeyEvent(SDL_KeyboardEvent* event)
|
|||||||
raiseAllKeys();
|
raiseAllKeys();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (event->keysym.sym == SDLK_x) {
|
else if (event->keysym.sym == SDLK_x && QGuiApplication::platformName() != "eglfs") {
|
||||||
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
|
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
"Detected full-screen toggle combo (SDLK)");
|
"Detected full-screen toggle combo (SDLK)");
|
||||||
Session::s_ActiveSession->toggleFullscreen();
|
Session::s_ActiveSession->toggleFullscreen();
|
||||||
@@ -277,7 +278,7 @@ void SdlInputHandler::handleKeyEvent(SDL_KeyboardEvent* event)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Check for the unbind combo (Ctrl+Alt+Shift+Z)
|
// 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,
|
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
"Detected mouse capture toggle combo (scancode)");
|
"Detected mouse capture toggle combo (scancode)");
|
||||||
|
|
||||||
@@ -289,8 +290,8 @@ void SdlInputHandler::handleKeyEvent(SDL_KeyboardEvent* event)
|
|||||||
raiseAllKeys();
|
raiseAllKeys();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Check for the full-screen combo (Ctrl+Alt+Shift+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) {
|
else if (event->keysym.scancode == SDL_SCANCODE_X && QGuiApplication::platformName() != "eglfs") {
|
||||||
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
|
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
"Detected full-screen toggle combo (scancode)");
|
"Detected full-screen toggle combo (scancode)");
|
||||||
Session::s_ActiveSession->toggleFullscreen();
|
Session::s_ActiveSession->toggleFullscreen();
|
||||||
|
|||||||
Reference in New Issue
Block a user