17#include "moc_qgs3dgamepadcontroller.cpp"
21#include <QtGamepad/QGamepad>
23QgsGamepad3DMapController::QgsGamepad3DMapController(
int gamepadDeviceId, QObject *parent )
25 , mGamepadDeviceId( gamepadDeviceId )
27 mGamepad =
new QGamepad( gamepadDeviceId,
this );
30 connect( mGamepad, &QGamepad::connectedChanged,
this, &QgsGamepad3DMapController::connectedChanged );
31 connect( mGamepad, &QGamepad::axisLeftXChanged,
this, &QgsGamepad3DMapController::axisLeftXChanged );
32 connect( mGamepad, &QGamepad::axisLeftYChanged,
this, &QgsGamepad3DMapController::axisLeftYChanged );
33 connect( mGamepad, &QGamepad::axisRightXChanged,
this, &QgsGamepad3DMapController::axisRightXChanged );
34 connect( mGamepad, &QGamepad::axisRightYChanged,
this, &QgsGamepad3DMapController::axisRightYChanged );
35 connect( mGamepad, &QGamepad::buttonAChanged,
this, &QgsGamepad3DMapController::buttonAChanged );
36 connect( mGamepad, &QGamepad::buttonBChanged,
this, &QgsGamepad3DMapController::buttonBChanged );
37 connect( mGamepad, &QGamepad::buttonXChanged,
this, &QgsGamepad3DMapController::buttonXChanged );
38 connect( mGamepad, &QGamepad::buttonYChanged,
this, &QgsGamepad3DMapController::buttonYChanged );
39 connect( mGamepad, &QGamepad::buttonL1Changed,
this, &QgsGamepad3DMapController::buttonL1Changed );
40 connect( mGamepad, &QGamepad::buttonR1Changed,
this, &QgsGamepad3DMapController::buttonR1Changed );
41 connect( mGamepad, &QGamepad::buttonL2Changed,
this, &QgsGamepad3DMapController::buttonL2Changed );
42 connect( mGamepad, &QGamepad::buttonR2Changed,
this, &QgsGamepad3DMapController::buttonR2Changed );
43 connect( mGamepad, &QGamepad::buttonSelectChanged,
this, &QgsGamepad3DMapController::buttonSelectChanged );
44 connect( mGamepad, &QGamepad::buttonStartChanged,
this, &QgsGamepad3DMapController::buttonStartChanged );
45 connect( mGamepad, &QGamepad::buttonL3Changed,
this, &QgsGamepad3DMapController::buttonL3Changed );
46 connect( mGamepad, &QGamepad::buttonR3Changed,
this, &QgsGamepad3DMapController::buttonR3Changed );
47 connect( mGamepad, &QGamepad::buttonUpChanged,
this, &QgsGamepad3DMapController::buttonUpChanged );
48 connect( mGamepad, &QGamepad::buttonDownChanged,
this, &QgsGamepad3DMapController::buttonDownChanged );
49 connect( mGamepad, &QGamepad::buttonLeftChanged,
this, &QgsGamepad3DMapController::buttonLeftChanged );
50 connect( mGamepad, &QGamepad::buttonRightChanged,
this, &QgsGamepad3DMapController::buttonRightChanged );
51 connect( mGamepad, &QGamepad::buttonCenterChanged,
this, &QgsGamepad3DMapController::buttonCenterChanged );
52 connect( mGamepad, &QGamepad::buttonGuideChanged,
this, &QgsGamepad3DMapController::buttonGuideChanged );
58QgsGamepad3DMapController *QgsGamepad3DMapController::clone()
const
60 return new QgsGamepad3DMapController( mGamepadDeviceId );
63QString QgsGamepad3DMapController::deviceId()
const
65 return QStringLiteral(
"gamepad3d:%1" ).arg( mGamepadDeviceId );
68bool QgsGamepad3DMapController::isConnected()
const
70 return mGamepad->isConnected();
73QString QgsGamepad3DMapController::name()
const
75 return mGamepad->name();
78double QgsGamepad3DMapController::axisLeftX()
const
80 return mGamepad->axisLeftX();
83double QgsGamepad3DMapController::axisLeftY()
const
85 return mGamepad->axisLeftY();
88double QgsGamepad3DMapController::axisRightX()
const
90 return mGamepad->axisRightX();
93double QgsGamepad3DMapController::axisRightY()
const
95 return mGamepad->axisRightY();
98bool QgsGamepad3DMapController::buttonA()
const
100 return mGamepad->buttonA();
103bool QgsGamepad3DMapController::buttonB()
const
105 return mGamepad->buttonB();
108bool QgsGamepad3DMapController::buttonX()
const
110 return mGamepad->buttonX();
113bool QgsGamepad3DMapController::buttonY()
const
115 return mGamepad->buttonY();
118bool QgsGamepad3DMapController::buttonL1()
const
120 return mGamepad->buttonL1();
123bool QgsGamepad3DMapController::buttonR1()
const
125 return mGamepad->buttonR1();
128double QgsGamepad3DMapController::buttonL2()
const
130 return mGamepad->buttonL2();
133double QgsGamepad3DMapController::buttonR2()
const
135 return mGamepad->buttonR2();
138bool QgsGamepad3DMapController::buttonSelect()
const
140 return mGamepad->buttonSelect();
143bool QgsGamepad3DMapController::buttonStart()
const
145 return mGamepad->buttonStart();
148bool QgsGamepad3DMapController::buttonL3()
const
150 return mGamepad->buttonL3();
153bool QgsGamepad3DMapController::buttonR3()
const
155 return mGamepad->buttonR3();
158bool QgsGamepad3DMapController::buttonUp()
const
160 return mGamepad->buttonUp();
163bool QgsGamepad3DMapController::buttonDown()
const
165 return mGamepad->buttonDown();
168bool QgsGamepad3DMapController::buttonLeft()
const
170 return mGamepad->buttonLeft();
173bool QgsGamepad3DMapController::buttonRight()
const
175 return mGamepad->buttonRight();
178bool QgsGamepad3DMapController::buttonCenter()
const
180 return mGamepad->buttonCenter();
183bool QgsGamepad3DMapController::buttonGuide()
const
185 return mGamepad->buttonGuide();
Abstract base class for all 3D map controllers.