mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2025-07-03 08:15:37 +00:00
Add a key combo to toggle cursor display in remote desktop mouse mode
This commit is contained in:
parent
5096ff6496
commit
bc39c721e3
@ -104,6 +104,20 @@ void SdlInputHandler::handleKeyEvent(SDL_KeyboardEvent* event)
|
|||||||
raiseAllKeys();
|
raiseAllKeys();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// Check for mouse show combo (Ctrl+Alt+Shift+C)
|
||||||
|
else if (event->keysym.sym == SDLK_c) {
|
||||||
|
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
|
"Detected show mouse combo (SDLK)");
|
||||||
|
|
||||||
|
if (!SDL_GetRelativeMouseMode()) {
|
||||||
|
SDL_ShowCursor(!SDL_ShowCursor(SDL_QUERY));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
|
"Cursor can only be shown in remote desktop mouse mode");
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
// Check for quit combo (Ctrl+Alt+Shift+Q)
|
// Check for quit combo (Ctrl+Alt+Shift+Q)
|
||||||
else if (event->keysym.scancode == SDL_SCANCODE_Q) {
|
else if (event->keysym.scancode == SDL_SCANCODE_Q) {
|
||||||
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
|
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
@ -168,6 +182,20 @@ void SdlInputHandler::handleKeyEvent(SDL_KeyboardEvent* event)
|
|||||||
raiseAllKeys();
|
raiseAllKeys();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// Check for mouse show combo (Ctrl+Alt+Shift+C)
|
||||||
|
else if (event->keysym.sym == SDL_SCANCODE_C) {
|
||||||
|
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
|
"Detected show mouse combo (scancode)");
|
||||||
|
|
||||||
|
if (!SDL_GetRelativeMouseMode()) {
|
||||||
|
SDL_ShowCursor(!SDL_ShowCursor(SDL_QUERY));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
|
"Cursor can only be shown in remote desktop mouse mode");
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event->repeat) {
|
if (event->repeat) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user