mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2024-11-16 08:17:58 +00:00
35 lines
614 B
C
35 lines
614 B
C
|
#pragma once
|
||
|
|
||
|
#include <QTimer>
|
||
|
#include <QEvent>
|
||
|
|
||
|
#include <SDL.h>
|
||
|
|
||
|
class SdlGamepadKeyNavigation : public QObject
|
||
|
{
|
||
|
Q_OBJECT
|
||
|
|
||
|
public:
|
||
|
SdlGamepadKeyNavigation();
|
||
|
|
||
|
~SdlGamepadKeyNavigation();
|
||
|
|
||
|
Q_INVOKABLE void enable();
|
||
|
|
||
|
Q_INVOKABLE void disable();
|
||
|
|
||
|
Q_INVOKABLE void setSettingsMode(bool settingsMode);
|
||
|
|
||
|
private:
|
||
|
void sendKey(QEvent::Type type, Qt::Key key, Qt::KeyboardModifiers modifiers = Qt::NoModifier);
|
||
|
|
||
|
private slots:
|
||
|
void onPollingTimerFired();
|
||
|
|
||
|
private:
|
||
|
QTimer* m_PollingTimer;
|
||
|
QList<SDL_GameController*> m_Gamepads;
|
||
|
bool m_Enabled;
|
||
|
bool m_SettingsMode;
|
||
|
};
|