#pragma once #include #include #include class SdlGamepadKeyNavigation : public QObject { Q_OBJECT public: SdlGamepadKeyNavigation(); ~SdlGamepadKeyNavigation(); Q_INVOKABLE void enable(); Q_INVOKABLE void disable(); Q_INVOKABLE void setUiNavMode(bool settingsMode); Q_INVOKABLE int getConnectedGamepads(); private: void sendKey(QEvent::Type type, Qt::Key key, Qt::KeyboardModifiers modifiers = Qt::NoModifier); void sendWheel(QPoint& angleDelta); private slots: void onPollingTimerFired(); private: QTimer* m_PollingTimer; QList m_Gamepads; bool m_Enabled; bool m_UiNavMode; Uint32 m_LastAxisNavigationEventTime; };