mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2024-12-13 21:02:28 +00:00
Add an option to disable the gamepad mouse button toggle
This commit is contained in:
parent
e1a697658e
commit
024af89be3
5 changed files with 26 additions and 2 deletions
|
@ -567,6 +567,22 @@ Flickable {
|
||||||
ToolTip.visible: hovered
|
ToolTip.visible: hovered
|
||||||
ToolTip.text: "When checked, mouse input is not accelerated or scaled by the OS before passing to Moonlight"
|
ToolTip.text: "When checked, mouse input is not accelerated or scaled by the OS before passing to Moonlight"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CheckBox {
|
||||||
|
id: gamepadMouseCheck
|
||||||
|
hoverEnabled: true
|
||||||
|
text: "Gamepad mouse mode support"
|
||||||
|
font.pointSize: 12
|
||||||
|
checked: StreamingPreferences.gamepadMouse
|
||||||
|
onCheckedChanged: {
|
||||||
|
StreamingPreferences.gamepadMouse = checked
|
||||||
|
}
|
||||||
|
|
||||||
|
ToolTip.delay: 1000
|
||||||
|
ToolTip.timeout: 3000
|
||||||
|
ToolTip.visible: hovered
|
||||||
|
ToolTip.text: "When enabled, holding the Start button will toggle mouse mode"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
#define SER_FRAMEPACING "framepacing"
|
#define SER_FRAMEPACING "framepacing"
|
||||||
#define SER_CONNWARNINGS "connwarnings"
|
#define SER_CONNWARNINGS "connwarnings"
|
||||||
#define SER_RICHPRESENCE "richpresence"
|
#define SER_RICHPRESENCE "richpresence"
|
||||||
|
#define SER_GAMEPADMOUSE "gamepadmouse"
|
||||||
|
|
||||||
StreamingPreferences::StreamingPreferences(QObject *parent)
|
StreamingPreferences::StreamingPreferences(QObject *parent)
|
||||||
: QObject(parent)
|
: QObject(parent)
|
||||||
|
@ -57,6 +58,7 @@ void StreamingPreferences::reload()
|
||||||
framePacing = settings.value(SER_FRAMEPACING, false).toBool();
|
framePacing = settings.value(SER_FRAMEPACING, false).toBool();
|
||||||
connectionWarnings = settings.value(SER_CONNWARNINGS, true).toBool();
|
connectionWarnings = settings.value(SER_CONNWARNINGS, true).toBool();
|
||||||
richPresence = settings.value(SER_RICHPRESENCE, true).toBool();
|
richPresence = settings.value(SER_RICHPRESENCE, true).toBool();
|
||||||
|
gamepadMouse = settings.value(SER_GAMEPADMOUSE, true).toBool();
|
||||||
audioConfig = static_cast<AudioConfig>(settings.value(SER_AUDIOCFG,
|
audioConfig = static_cast<AudioConfig>(settings.value(SER_AUDIOCFG,
|
||||||
static_cast<int>(AudioConfig::AC_STEREO)).toInt());
|
static_cast<int>(AudioConfig::AC_STEREO)).toInt());
|
||||||
videoCodecConfig = static_cast<VideoCodecConfig>(settings.value(SER_VIDEOCFG,
|
videoCodecConfig = static_cast<VideoCodecConfig>(settings.value(SER_VIDEOCFG,
|
||||||
|
@ -89,6 +91,7 @@ void StreamingPreferences::save()
|
||||||
settings.setValue(SER_FRAMEPACING, framePacing);
|
settings.setValue(SER_FRAMEPACING, framePacing);
|
||||||
settings.setValue(SER_CONNWARNINGS, connectionWarnings);
|
settings.setValue(SER_CONNWARNINGS, connectionWarnings);
|
||||||
settings.setValue(SER_RICHPRESENCE, richPresence);
|
settings.setValue(SER_RICHPRESENCE, richPresence);
|
||||||
|
settings.setValue(SER_GAMEPADMOUSE, gamepadMouse);
|
||||||
settings.setValue(SER_AUDIOCFG, static_cast<int>(audioConfig));
|
settings.setValue(SER_AUDIOCFG, static_cast<int>(audioConfig));
|
||||||
settings.setValue(SER_VIDEOCFG, static_cast<int>(videoCodecConfig));
|
settings.setValue(SER_VIDEOCFG, static_cast<int>(videoCodecConfig));
|
||||||
settings.setValue(SER_VIDEODEC, static_cast<int>(videoDecoderSelection));
|
settings.setValue(SER_VIDEODEC, static_cast<int>(videoDecoderSelection));
|
||||||
|
|
|
@ -64,7 +64,8 @@ public:
|
||||||
Q_PROPERTY(bool startWindowed MEMBER startWindowed NOTIFY startWindowedChanged)
|
Q_PROPERTY(bool startWindowed MEMBER startWindowed NOTIFY startWindowedChanged)
|
||||||
Q_PROPERTY(bool framePacing MEMBER framePacing NOTIFY framePacingChanged)
|
Q_PROPERTY(bool framePacing MEMBER framePacing NOTIFY framePacingChanged)
|
||||||
Q_PROPERTY(bool connectionWarnings MEMBER connectionWarnings NOTIFY connectionWarningsChanged)
|
Q_PROPERTY(bool connectionWarnings MEMBER connectionWarnings NOTIFY connectionWarningsChanged)
|
||||||
Q_PROPERTY(bool richPresence MEMBER richPresence NOTIFY richPresenceChanged);
|
Q_PROPERTY(bool richPresence MEMBER richPresence NOTIFY richPresenceChanged)
|
||||||
|
Q_PROPERTY(bool gamepadMouse MEMBER gamepadMouse NOTIFY gamepadMouseChanged)
|
||||||
Q_PROPERTY(AudioConfig audioConfig MEMBER audioConfig NOTIFY audioConfigChanged)
|
Q_PROPERTY(AudioConfig audioConfig MEMBER audioConfig NOTIFY audioConfigChanged)
|
||||||
Q_PROPERTY(VideoCodecConfig videoCodecConfig MEMBER videoCodecConfig NOTIFY videoCodecConfigChanged)
|
Q_PROPERTY(VideoCodecConfig videoCodecConfig MEMBER videoCodecConfig NOTIFY videoCodecConfigChanged)
|
||||||
Q_PROPERTY(VideoDecoderSelection videoDecoderSelection MEMBER videoDecoderSelection NOTIFY videoDecoderSelectionChanged)
|
Q_PROPERTY(VideoDecoderSelection videoDecoderSelection MEMBER videoDecoderSelection NOTIFY videoDecoderSelectionChanged)
|
||||||
|
@ -88,6 +89,7 @@ public:
|
||||||
bool framePacing;
|
bool framePacing;
|
||||||
bool connectionWarnings;
|
bool connectionWarnings;
|
||||||
bool richPresence;
|
bool richPresence;
|
||||||
|
bool gamepadMouse;
|
||||||
AudioConfig audioConfig;
|
AudioConfig audioConfig;
|
||||||
VideoCodecConfig videoCodecConfig;
|
VideoCodecConfig videoCodecConfig;
|
||||||
VideoDecoderSelection videoDecoderSelection;
|
VideoDecoderSelection videoDecoderSelection;
|
||||||
|
@ -113,5 +115,6 @@ signals:
|
||||||
void framePacingChanged();
|
void framePacingChanged();
|
||||||
void connectionWarningsChanged();
|
void connectionWarningsChanged();
|
||||||
void richPresenceChanged();
|
void richPresenceChanged();
|
||||||
|
void gamepadMouseChanged();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -51,6 +51,7 @@ const int SdlInputHandler::k_ButtonMap[] = {
|
||||||
|
|
||||||
SdlInputHandler::SdlInputHandler(StreamingPreferences& prefs, NvComputer*, int streamWidth, int streamHeight)
|
SdlInputHandler::SdlInputHandler(StreamingPreferences& prefs, NvComputer*, int streamWidth, int streamHeight)
|
||||||
: m_MultiController(prefs.multiController),
|
: m_MultiController(prefs.multiController),
|
||||||
|
m_GamepadMouse(prefs.gamepadMouse),
|
||||||
m_MouseMoveTimer(0),
|
m_MouseMoveTimer(0),
|
||||||
m_LeftButtonReleaseTimer(0),
|
m_LeftButtonReleaseTimer(0),
|
||||||
m_RightButtonReleaseTimer(0),
|
m_RightButtonReleaseTimer(0),
|
||||||
|
@ -839,7 +840,7 @@ void SdlInputHandler::handleControllerButtonEvent(SDL_ControllerButtonEvent* eve
|
||||||
"Mouse emulation deactivated");
|
"Mouse emulation deactivated");
|
||||||
Session::get()->notifyMouseEmulationMode(false);
|
Session::get()->notifyMouseEmulationMode(false);
|
||||||
}
|
}
|
||||||
else {
|
else if (m_GamepadMouse) {
|
||||||
// Send the start button up event to the host, since we won't do it below
|
// Send the start button up event to the host, since we won't do it below
|
||||||
sendGamepadState(state);
|
sendGamepadState(state);
|
||||||
|
|
||||||
|
|
|
@ -89,6 +89,7 @@ private:
|
||||||
Uint32 mouseEmulationTimerCallback(Uint32 interval, void* param);
|
Uint32 mouseEmulationTimerCallback(Uint32 interval, void* param);
|
||||||
|
|
||||||
bool m_MultiController;
|
bool m_MultiController;
|
||||||
|
bool m_GamepadMouse;
|
||||||
SDL_TimerID m_MouseMoveTimer;
|
SDL_TimerID m_MouseMoveTimer;
|
||||||
SDL_atomic_t m_MouseDeltaX;
|
SDL_atomic_t m_MouseDeltaX;
|
||||||
SDL_atomic_t m_MouseDeltaY;
|
SDL_atomic_t m_MouseDeltaY;
|
||||||
|
|
Loading…
Reference in a new issue