20#include <QtGamepad/QGamepad>
22QgsGamepad3DMapController::QgsGamepad3DMapController(
int gamepadDeviceId, QObject *parent )
24 , mGamepadDeviceId( gamepadDeviceId )
26 mGamepad =
new QGamepad( gamepadDeviceId,
this );
29 connect( mGamepad, &QGamepad::connectedChanged,
this, &QgsGamepad3DMapController::connectedChanged );
30 connect( mGamepad, &QGamepad::axisLeftXChanged,
this, &QgsGamepad3DMapController::axisLeftXChanged );
31 connect( mGamepad, &QGamepad::axisLeftYChanged,
this, &QgsGamepad3DMapController::axisLeftYChanged );
32 connect( mGamepad, &QGamepad::axisRightXChanged,
this, &QgsGamepad3DMapController::axisRightXChanged );
33 connect( mGamepad, &QGamepad::axisRightYChanged,
this, &QgsGamepad3DMapController::axisRightYChanged );
34 connect( mGamepad, &QGamepad::buttonAChanged,
this, &QgsGamepad3DMapController::buttonAChanged );
35 connect( mGamepad, &QGamepad::buttonBChanged,
this, &QgsGamepad3DMapController::buttonBChanged );
36 connect( mGamepad, &QGamepad::buttonXChanged,
this, &QgsGamepad3DMapController::buttonXChanged );
37 connect( mGamepad, &QGamepad::buttonYChanged,
this, &QgsGamepad3DMapController::buttonYChanged );
38 connect( mGamepad, &QGamepad::buttonL1Changed,
this, &QgsGamepad3DMapController::buttonL1Changed );
39 connect( mGamepad, &QGamepad::buttonR1Changed,
this, &QgsGamepad3DMapController::buttonR1Changed );
40 connect( mGamepad, &QGamepad::buttonL2Changed,
this, &QgsGamepad3DMapController::buttonL2Changed );
41 connect( mGamepad, &QGamepad::buttonR2Changed,
this, &QgsGamepad3DMapController::buttonR2Changed );
42 connect( mGamepad, &QGamepad::buttonSelectChanged,
this, &QgsGamepad3DMapController::buttonSelectChanged );
43 connect( mGamepad, &QGamepad::buttonStartChanged,
this, &QgsGamepad3DMapController::buttonStartChanged );
44 connect( mGamepad, &QGamepad::buttonL3Changed,
this, &QgsGamepad3DMapController::buttonL3Changed );
45 connect( mGamepad, &QGamepad::buttonR3Changed,
this, &QgsGamepad3DMapController::buttonR3Changed );
46 connect( mGamepad, &QGamepad::buttonUpChanged,
this, &QgsGamepad3DMapController::buttonUpChanged );
47 connect( mGamepad, &QGamepad::buttonDownChanged,
this, &QgsGamepad3DMapController::buttonDownChanged );
48 connect( mGamepad, &QGamepad::buttonLeftChanged,
this, &QgsGamepad3DMapController::buttonLeftChanged );
49 connect( mGamepad, &QGamepad::buttonRightChanged,
this, &QgsGamepad3DMapController::buttonRightChanged );
50 connect( mGamepad, &QGamepad::buttonCenterChanged,
this, &QgsGamepad3DMapController::buttonCenterChanged );
51 connect( mGamepad, &QGamepad::buttonGuideChanged,
this, &QgsGamepad3DMapController::buttonGuideChanged );
57QgsGamepad3DMapController *QgsGamepad3DMapController::clone()
const
59 return new QgsGamepad3DMapController( mGamepadDeviceId );
62QString QgsGamepad3DMapController::deviceId()
const
64 return QStringLiteral(
"gamepad3d:%1" ).arg( mGamepadDeviceId );
67bool QgsGamepad3DMapController::isConnected()
const
69 return mGamepad->isConnected();
72QString QgsGamepad3DMapController::name()
const
74 return mGamepad->name();
77double QgsGamepad3DMapController::axisLeftX()
const
79 return mGamepad->axisLeftX();
82double QgsGamepad3DMapController::axisLeftY()
const
84 return mGamepad->axisLeftY();
87double QgsGamepad3DMapController::axisRightX()
const
89 return mGamepad->axisRightX();
92double QgsGamepad3DMapController::axisRightY()
const
94 return mGamepad->axisRightY();
97bool QgsGamepad3DMapController::buttonA()
const
99 return mGamepad->buttonA();
102bool QgsGamepad3DMapController::buttonB()
const
104 return mGamepad->buttonB();
107bool QgsGamepad3DMapController::buttonX()
const
109 return mGamepad->buttonX();
112bool QgsGamepad3DMapController::buttonY()
const
114 return mGamepad->buttonY();
117bool QgsGamepad3DMapController::buttonL1()
const
119 return mGamepad->buttonL1();
122bool QgsGamepad3DMapController::buttonR1()
const
124 return mGamepad->buttonR1();
127double QgsGamepad3DMapController::buttonL2()
const
129 return mGamepad->buttonL2();
132double QgsGamepad3DMapController::buttonR2()
const
134 return mGamepad->buttonR2();
137bool QgsGamepad3DMapController::buttonSelect()
const
139 return mGamepad->buttonSelect();
142bool QgsGamepad3DMapController::buttonStart()
const
144 return mGamepad->buttonStart();
147bool QgsGamepad3DMapController::buttonL3()
const
149 return mGamepad->buttonL3();
152bool QgsGamepad3DMapController::buttonR3()
const
154 return mGamepad->buttonR3();
157bool QgsGamepad3DMapController::buttonUp()
const
159 return mGamepad->buttonUp();
162bool QgsGamepad3DMapController::buttonDown()
const
164 return mGamepad->buttonDown();
167bool QgsGamepad3DMapController::buttonLeft()
const
169 return mGamepad->buttonLeft();
172bool QgsGamepad3DMapController::buttonRight()
const
174 return mGamepad->buttonRight();
177bool QgsGamepad3DMapController::buttonCenter()
const
179 return mGamepad->buttonCenter();
182bool QgsGamepad3DMapController::buttonGuide()
const
184 return mGamepad->buttonGuide();
Abstract base class for all 3D map controllers.