Rework window focus tracking for gamepad navigation

This commit is contained in:
Cameron Gutman
2024-10-18 21:20:56 -05:00
parent 4af9623727
commit b6a3369243
4 changed files with 41 additions and 38 deletions
+5
View File
@@ -20,6 +20,8 @@ public:
Q_INVOKABLE void disable();
Q_INVOKABLE void notifyWindowFocus(bool hasFocus);
Q_INVOKABLE void setUiNavMode(bool settingsMode);
Q_INVOKABLE int getConnectedGamepads();
@@ -27,6 +29,8 @@ public:
private:
void sendKey(QEvent::Type type, Qt::Key key, Qt::KeyboardModifiers modifiers = Qt::NoModifier);
void updateTimerState();
private slots:
void onPollingTimerFired();
@@ -37,5 +41,6 @@ private:
bool m_Enabled;
bool m_UiNavMode;
bool m_FirstPoll;
bool m_HasFocus;
Uint32 m_LastAxisNavigationEventTime;
};