#include <JoystickSDL.h>
Signals | |
| void | axisDriftDetected (const QVariantList &driftingAxes) |
| Emitted when significant axis drift is detected on open. | |
| Signals inherited from Joystick | |
| void | buttonActionsChanged () |
| void | assignableActionsChanged () |
| void | playerIndexChanged () |
| void | batteryStateChanged () |
| void | connectionStateChanged (const QString &newState) |
| void | linkedGroupChanged () |
| void | axisValues (float roll, float pitch, float yaw, float throttle) |
| void | startContinuousZoom (int direction) |
| void | stopContinuousZoom () |
| void | stepZoom (int direction) |
| void | startContinuousFocus (int direction) |
| void | stopContinuousFocus () |
| void | stepFocus (int direction) |
| void | stepCamera (int direction) |
| void | stepStream (int direction) |
| void | triggerCamera () |
| void | startVideoRecord () |
| void | stopVideoRecord () |
| void | toggleVideoRecord () |
| void | gimbalPitchStart (int direction) |
| void | gimbalYawStart (int direction) |
| void | gimbalPitchStop () |
| void | gimbalYawStop () |
| void | centerGimbal () |
| void | gimbalYawLock (bool lock) |
| void | setArmed (bool arm) |
| void | setVtolInFwdFlight (bool set) |
| void | setFlightMode (const QString &flightMode) |
| void | emergencyStop () |
| void | gripperAction (GRIPPER_ACTIONS gripperAction) |
| void | landingGearDeploy () |
| void | landingGearRetract () |
| void | motorInterlock (bool enable) |
| void | unknownAction (const QString &action) |
| void | vehicleJoystickData (float roll, float pitch, float yaw, float throttle, uint16_t buttonsLow, uint16_t buttonsHigh, float gimbalPitch, float gimbalYaw) |
| void | rawChannelValuesChanged (QVector< int > channelValues) |
| Signalled during PollingForConfiguration. | |
| void | rawButtonPressedChanged (int index, bool pressed) |
| Signalled during PollingForConfiguration. | |
| void | gyroscopeDataUpdated (const QVector3D &data) |
| void | accelerometerDataUpdated (const QVector3D &data) |
| void | touchpadEvent (int touchpad, int finger, bool down, float x, float y, float pressure) |
| void | mappingRemapped () |
| void | updateComplete () |
Public Member Functions | |
| JoystickSDL (const QString &name, const QList< int > &gamepadAxes, const QList< int > &nonGamepadAxes, int buttonCount, int hatCount, int instanceId, QObject *parent=nullptr) | |
| ~JoystickSDL () override | |
| int | instanceId () const |
| void | setInstanceId (int instanceId) |
| bool | requiresCalibration () const override |
| bool | hasRumble () const override |
| bool | hasRumbleTriggers () const override |
| bool | hasLED () const override |
| void | rumble (quint16 lowFreq, quint16 highFreq, quint32 durationMs) override |
| void | rumbleTriggers (quint16 left, quint16 right, quint32 durationMs) override |
| void | setLED (quint8 red, quint8 green, quint8 blue) override |
| bool | sendEffect (const QByteArray &data) override |
| QString | guid () const override |
| quint16 | vendorId () const override |
| quint16 | productId () const override |
| QString | serial () const override |
| QString | deviceType () const override |
| QString | path () const override |
| bool | isVirtual () const override |
| quint16 | firmwareVersion () const override |
| QString | connectionType () const override |
| int | playerIndex () const override |
| void | setPlayerIndex (int index) override |
| int | batteryPercent () const override |
| QString | powerState () const override |
| bool | isGamepad () const override |
| QString | gamepadType () const override |
| QString | axisLabel (int axis) const override |
| QString | buttonLabel (int button) const override |
| QString | getMapping () const override |
| bool | addMapping (const QString &mapping) override |
| QVariantMap | getAxisBinding (int axis) const override |
| QVariantMap | getButtonBinding (int button) const override |
| bool | hasGyroscope () const override |
| bool | hasAccelerometer () const override |
| bool | setGyroscopeEnabled (bool enabled) override |
| bool | setAccelerometerEnabled (bool enabled) override |
| QVector3D | gyroscopeData () const override |
| QVector3D | accelerometerData () const override |
| float | gyroscopeDataRate () const override |
| float | accelerometerDataRate () const override |
| int | touchpadCount () const override |
| int | touchpadFingerCount (int touchpad) const override |
| QVariantMap | getTouchpadFinger (int touchpad, int finger) const override |
| int | ballCount () const override |
| QVariantMap | getBall (int ball) const override |
| bool | hasButton (int button) const override |
| bool | hasAxis (int axis) const override |
| QString | realGamepadType () const override |
| QString | buttonLabelForType (int button) const override |
| bool | hasHaptic () const override |
| int | hapticEffectsCount () const override |
| bool | hapticRumbleSupported () const override |
| bool | hapticRumbleInit () override |
| bool | hapticRumblePlay (float strength, quint32 durationMs) override |
| void | hapticRumbleStop () override |
| QString | getMappingForGUID (const QString &guid) const override |
| bool | setVirtualAxis (int axis, int value) override |
| bool | setVirtualButton (int button, bool down) override |
| bool | setVirtualHat (int hat, quint8 value) override |
| bool | setVirtualBall (int ball, int dx, int dy) override |
| bool | setVirtualTouchpad (int touchpad, int finger, bool down, float x, float y, float pressure) override |
| bool | sendVirtualSensorData (int sensorType, float x, float y, float z) override |
| bool | hasMonoLED () const override |
| bool | hasRGBLED () const override |
| bool | hasPlayerLED () const override |
| QString | connectionState () const override |
| QVariantMap | getAxisInitialState (int axis) const override |
| bool | setMapping (const QString &mapping) override |
| void | updateCachedGyroData (const QVector3D &data) |
| void | updateCachedAccelData (const QVector3D &data) |
| void | checkConnectionStateChanged () |
| Q_INVOKABLE QVariantList | detectAxisDrift (int threshold=8000) const |
| Public Member Functions inherited from Joystick | |
| Joystick (const QString &name, int axisCount, int buttonCount, int hatCount, QObject *parent=nullptr) | |
| virtual | ~Joystick () |
| Q_INVOKABLE void | setButtonRepeat (int button, bool repeat) |
| Q_INVOKABLE bool | getButtonRepeat (int button) |
| Q_INVOKABLE void | setButtonAction (int button, const QString &action) |
| Q_INVOKABLE QString | getButtonAction (int button) const |
| JoystickSettings * | settings () |
| QString | name () const |
| int | buttonCount () const |
| int | axisCount () const |
| QStringList | buttonActions () const |
| QString | buttonActionNone () const |
| QString | disabledActionName () const |
| const QmlObjectListModel * | assignableActions () const |
| QStringList | assignableActionTitles () const |
| QString | linkedGroupId () const |
| HOTAS/Multi-device linking (devices with same groupId act as single joystick). | |
| void | setLinkedGroupId (const QString &groupId) |
| QString | linkedGroupRole () const |
| void | setLinkedGroupRole (const QString &role) |
| void | setAxisCalibration (int axis, const AxisCalibration_t &calibration) |
| Joystick::AxisCalibration_t | getAxisCalibration (int axis) const |
| RemoteControlCalibrationController::StickFunction | mapAxisFunctionToRCCStickFunction (AxisFunction_t axisFunction) const |
| AxisFunction_t | mapRCCStickFunctionToAxisFunction (RemoteControlCalibrationController::StickFunction stickFunction) const |
| void | setFunctionForChannel (RemoteControlCalibrationController::StickFunction stickFunction, int channel) |
| int | getChannelForFunction (RemoteControlCalibrationController::StickFunction stickFunction) const |
| Q_INVOKABLE void | startConfiguration () |
| Tells the joystick that the configuration UI is being displayed so it can do any special processing required. | |
| Q_INVOKABLE void | stopConfiguration () |
| Tells the joystick that the configuration UI is being closed so it can do any special processing required. | |
| void | stop () |
Static Public Member Functions | |
| static bool | init () |
| static void | shutdown (bool deleteDiscoveryCache=true) |
| static QMap< QString, Joystick * > | discover () |
| Static Public Member Functions inherited from Joystick | |
| static QString | axisFunctionToString (AxisFunction_t function) |
Friends | |
| class | MockJoystick |
Definition at line 18 of file JoystickSDL.h.
|
explicit |
Definition at line 111 of file JoystickSDL.cc.
References Joystick::buttonCount(), instanceId(), Joystick::Joystick(), and Joystick::name().
Referenced by discover().
|
override |
Definition at line 124 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 959 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 988 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 830 of file JoystickSDL.cc.
|
signal |
Emitted when significant axis drift is detected on open.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 778 of file JoystickSDL.cc.
Referenced by detectAxisDrift().
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 1039 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 723 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 802 of file JoystickSDL.cc.
Referenced by buttonLabelForType().
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 1106 of file JoystickSDL.cc.
References buttonLabel().
| void JoystickSDL::checkConnectionStateChanged | ( | ) |
Definition at line 1416 of file JoystickSDL.cc.
References connectionState(), and Joystick::connectionStateChanged().
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 1299 of file JoystickSDL.cc.
References connectionType().
Referenced by checkConnectionStateChanged().
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 677 of file JoystickSDL.cc.
References SDLJoystick::connectionStateToString().
Referenced by connectionState().
| QVariantList JoystickSDL::detectAxisDrift | ( | int | threshold = 8000 | ) | const |
Check for axis drift (significant deviation from center at rest) Returns list of axes with detected drift and their values
Definition at line 1426 of file JoystickSDL.cc.
References axisLabel().
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 623 of file JoystickSDL.cc.
|
static |
Main thread only. Off the main thread it logs an error and returns the previous discovery, whose joysticks the main thread may delete at any time.
Definition at line 187 of file JoystickSDL.cc.
References Joystick::axisCount(), Joystick::buttonCount(), SDLJoystick::getNameForInstanceId(), JoystickSDL(), Joystick::name(), SDLJoystick::pumpEvents(), s_discoveryCache, and s_discoveryCacheMutex.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 669 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 766 of file JoystickSDL.cc.
References SDLJoystick::gamepadTypeDisplayName().
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 846 of file JoystickSDL.cc.
References SDLJoystick::findBinding().
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 1308 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 1047 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 879 of file JoystickSDL.cc.
References SDLJoystick::findBinding().
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 817 of file JoystickSDL.cc.
|
overridevirtual |
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 1016 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 585 of file JoystickSDL.cc.
Referenced by getMappingForGUID().
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 938 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 980 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 1147 of file JoystickSDL.cc.
|
nodiscardoverridevirtual |
Reimplemented from Joystick.
Definition at line 1164 of file JoystickSDL.cc.
Referenced by hapticRumblePlay().
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 1191 of file JoystickSDL.cc.
References hapticRumbleInit().
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 1206 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 1155 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 906 of file JoystickSDL.cc.
Referenced by setAccelerometerEnabled().
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 1078 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 1067 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 898 of file JoystickSDL.cc.
Referenced by setGyroscopeEnabled().
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 1139 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 524 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 1280 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 1290 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 1285 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 512 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 518 of file JoystickSDL.cc.
|
staticnodiscard |
Definition at line 162 of file JoystickSDL.cc.
References SDLJoystick::init(), and sdlEventWatcher().
Referenced by JoystickManager::init().
|
inline |
Definition at line 32 of file JoystickSDL.h.
Referenced by JoystickSDL(), MockJoystick, and setInstanceId().
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 761 of file JoystickSDL.cc.
Referenced by requiresCalibration().
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 664 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 653 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 692 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 733 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 604 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 1094 of file JoystickSDL.cc.
References SDLJoystick::gamepadTypeDisplayName().
|
inlineoverridevirtual |
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 534 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 547 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 569 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 1384 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 612 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 926 of file JoystickSDL.cc.
References hasAccelerometer().
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 914 of file JoystickSDL.cc.
References hasGyroscope().
|
inline |
Definition at line 33 of file JoystickSDL.h.
References instanceId().
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 556 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 1330 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 703 of file JoystickSDL.cc.
References Joystick::playerIndexChanged().
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 1237 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 1347 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 1250 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 1263 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 1360 of file JoystickSDL.cc.
|
static |
Definition at line 172 of file JoystickSDL.cc.
References s_discoveryCache, s_discoveryCacheMutex, sdlEventWatcher(), and SDLJoystick::shutdown().
Referenced by JoystickManager::~JoystickManager().
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 1000 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 1008 of file JoystickSDL.cc.
| void JoystickSDL::updateCachedAccelData | ( | const QVector3D & | data | ) |
Definition at line 1409 of file JoystickSDL.cc.
References Joystick::accelerometerDataUpdated().
| void JoystickSDL::updateCachedGyroData | ( | const QVector3D & | data | ) |
Definition at line 1402 of file JoystickSDL.cc.
References Joystick::gyroscopeDataUpdated().
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 596 of file JoystickSDL.cc.
|
friend |
Definition at line 25 of file JoystickSDL.h.
References Joystick::buttonCount(), instanceId(), MockJoystick, and Joystick::name().
Referenced by MockJoystick.