mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2025-07-03 16:25:54 +00:00
Don't reload preferences every time we poll for GUI gamepad input
This commit is contained in:
parent
0e1190a059
commit
cf544a8703
@ -4,7 +4,6 @@
|
|||||||
#include <QGuiApplication>
|
#include <QGuiApplication>
|
||||||
#include <QWindow>
|
#include <QWindow>
|
||||||
|
|
||||||
#include "settings/streamingpreferences.h"
|
|
||||||
#include "settings/mappingmanager.h"
|
#include "settings/mappingmanager.h"
|
||||||
|
|
||||||
#define AXIS_NAVIGATION_REPEAT_DELAY 150
|
#define AXIS_NAVIGATION_REPEAT_DELAY 150
|
||||||
@ -93,7 +92,6 @@ void SdlGamepadKeyNavigation::disable()
|
|||||||
void SdlGamepadKeyNavigation::onPollingTimerFired()
|
void SdlGamepadKeyNavigation::onPollingTimerFired()
|
||||||
{
|
{
|
||||||
SDL_Event event;
|
SDL_Event event;
|
||||||
StreamingPreferences prefs;
|
|
||||||
|
|
||||||
// Discard any pending button events on the first poll to avoid picking up
|
// Discard any pending button events on the first poll to avoid picking up
|
||||||
// stale input data from the stream session (like the quit combo).
|
// stale input data from the stream session (like the quit combo).
|
||||||
@ -121,7 +119,7 @@ void SdlGamepadKeyNavigation::onPollingTimerFired()
|
|||||||
QEvent::Type::KeyPress : QEvent::Type::KeyRelease;
|
QEvent::Type::KeyPress : QEvent::Type::KeyRelease;
|
||||||
|
|
||||||
// Swap face buttons if needed
|
// Swap face buttons if needed
|
||||||
if (prefs.swapFaceButtons) {
|
if (m_Prefs.swapFaceButtons) {
|
||||||
switch (event.cbutton.button) {
|
switch (event.cbutton.button) {
|
||||||
case SDL_CONTROLLER_BUTTON_A:
|
case SDL_CONTROLLER_BUTTON_A:
|
||||||
event.cbutton.button = SDL_CONTROLLER_BUTTON_B;
|
event.cbutton.button = SDL_CONTROLLER_BUTTON_B;
|
||||||
|
@ -5,6 +5,8 @@
|
|||||||
|
|
||||||
#include <SDL.h>
|
#include <SDL.h>
|
||||||
|
|
||||||
|
#include "settings/streamingpreferences.h"
|
||||||
|
|
||||||
class SdlGamepadKeyNavigation : public QObject
|
class SdlGamepadKeyNavigation : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@ -35,4 +37,5 @@ private:
|
|||||||
bool m_UiNavMode;
|
bool m_UiNavMode;
|
||||||
bool m_FirstPoll;
|
bool m_FirstPoll;
|
||||||
Uint32 m_LastAxisNavigationEventTime;
|
Uint32 m_LastAxisNavigationEventTime;
|
||||||
|
StreamingPreferences m_Prefs;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user