Add separate keyboard and mouse input shortcuts
Some checks are pending
Build / setup (push) Waiting to run
Build / build-appimage (push) Blocked by required conditions
Build / build-steamlink (push) Blocked by required conditions
Build / build-windows-macos (push) Blocked by required conditions

This commit is contained in:
Joey Yakimowich-Payne 2026-02-12 09:27:36 -07:00
commit 25310655c5
6 changed files with 78 additions and 15 deletions

View file

@ -648,9 +648,22 @@ void SdlInputHandler::handleControllerButtonEvent(SDL_ControllerButtonEvent* eve
if (state->buttons == (BACK_FLAG | LB_FLAG | RB_FLAG | Y_FLAG)) {
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
"Detected keyboard/mouse input toggle gamepad combo");
"Detected keyboard input toggle gamepad combo");
Session::get()->toggleKeyboardMouseInputAllowed();
Session::get()->toggleKeyboardInputAllowed();
if (isGamepadInputAllowed()) {
LiSendMultiControllerEvent(state->index, m_GamepadMask,
0, 0, 0, 0, 0, 0, 0);
}
return;
}
if (state->buttons == (BACK_FLAG | LB_FLAG | RB_FLAG | UP_FLAG)) {
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
"Detected mouse input toggle gamepad combo");
Session::get()->toggleMouseInputAllowed();
if (isGamepadInputAllowed()) {
LiSendMultiControllerEvent(state->index, m_GamepadMask,

View file

@ -130,10 +130,15 @@ SdlInputHandler::SdlInputHandler(StreamingPreferences& prefs, int streamWidth, i
m_SpecialKeyCombos[KeyComboPasteText].scanCode = SDL_SCANCODE_V;
m_SpecialKeyCombos[KeyComboPasteText].enabled = true;
m_SpecialKeyCombos[KeyComboToggleKeyboardMouseInput].keyCombo = KeyComboToggleKeyboardMouseInput;
m_SpecialKeyCombos[KeyComboToggleKeyboardMouseInput].keyCode = SDLK_k;
m_SpecialKeyCombos[KeyComboToggleKeyboardMouseInput].scanCode = SDL_SCANCODE_K;
m_SpecialKeyCombos[KeyComboToggleKeyboardMouseInput].enabled = true;
m_SpecialKeyCombos[KeyComboToggleKeyboardInput].keyCombo = KeyComboToggleKeyboardInput;
m_SpecialKeyCombos[KeyComboToggleKeyboardInput].keyCode = SDLK_k;
m_SpecialKeyCombos[KeyComboToggleKeyboardInput].scanCode = SDL_SCANCODE_K;
m_SpecialKeyCombos[KeyComboToggleKeyboardInput].enabled = true;
m_SpecialKeyCombos[KeyComboToggleMouseInput].keyCombo = KeyComboToggleMouseInput;
m_SpecialKeyCombos[KeyComboToggleMouseInput].keyCode = SDLK_o;
m_SpecialKeyCombos[KeyComboToggleMouseInput].scanCode = SDL_SCANCODE_O;
m_SpecialKeyCombos[KeyComboToggleMouseInput].enabled = true;
m_SpecialKeyCombos[KeyComboToggleGamepadInput].keyCombo = KeyComboToggleGamepadInput;
m_SpecialKeyCombos[KeyComboToggleGamepadInput].keyCode = SDLK_g;

View file

@ -174,7 +174,8 @@ private:
KeyComboToggleCursorHide,
KeyComboToggleMinimize,
KeyComboPasteText,
KeyComboToggleKeyboardMouseInput,
KeyComboToggleKeyboardInput,
KeyComboToggleMouseInput,
KeyComboToggleGamepadInput,
KeyComboVolumeUp,
KeyComboVolumeDown,

View file

@ -142,11 +142,19 @@ void SdlInputHandler::performSpecialKeyCombo(KeyCombo combo)
break;
}
case KeyComboToggleKeyboardMouseInput:
case KeyComboToggleKeyboardInput:
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
"Detected keyboard/mouse input toggle combo");
"Detected keyboard input toggle combo");
if (auto session = Session::get(); session != nullptr) {
session->toggleKeyboardMouseInputAllowed();
session->toggleKeyboardInputAllowed();
}
break;
case KeyComboToggleMouseInput:
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
"Detected mouse input toggle combo");
if (auto session = Session::get(); session != nullptr) {
session->toggleMouseInputAllowed();
}
break;