|
QGroundControl
Ground Control Station for MAVLink Drones
|
Classes | |
| class | JoystickLock |
| RAII lock guard for joysticks. More... | |
Functions | |
| static void | loadGamepadMappings () |
| bool | init () |
| Initialize SDL joystick/gamepad subsystems with QGC-specific hints. | |
| void | shutdown () |
| Shutdown SDL joystick/gamepad subsystems. | |
| bool | isInitialized () |
| Check if SDL joystick subsystem is initialized. | |
| void | pumpEvents () |
| Pump SDL events (call periodically) | |
| void | setJoystickEventsEnabled (bool enabled) |
| Enable/disable joystick event processing. | |
| bool | joystickEventsEnabled () |
| void | setGamepadEventsEnabled (bool enabled) |
| Enable/disable gamepad event processing. | |
| bool | gamepadEventsEnabled () |
| void | updateJoysticks () |
| Update joystick/gamepad state. | |
| void | updateGamepads () |
| void | lockJoysticks () |
| Lock joystick access for thread-safe operations. | |
| void | unlockJoysticks () |
| QString | gamepadTypeToString (int type) |
| Gamepad type conversions. | |
| int | gamepadTypeFromString (const QString &str) |
| QString | gamepadTypeDisplayName (int type) |
| QString | gamepadAxisToString (int axis) |
| Gamepad axis conversions. | |
| int | gamepadAxisFromString (const QString &str) |
| QString | gamepadButtonToString (int button) |
| Gamepad button conversions. | |
| int | gamepadButtonFromString (const QString &str) |
| QString | connectionStateToString (int state) |
| Connection state to string. | |
| QVariantMap | getGUIDInfo (const QString &guid) |
| Parse GUID info (vendor, product, version, crc16) | |
| QString | getMappingForGUID (const QString &guid) |
| Get mapping string for a GUID. | |
| int | addMappingsFromFile (const QString &filePath) |
| Add gamepad mappings from a file. | |
| bool | addMapping (const QString &mapping) |
| Add a single mapping string. | |
| QString | userMappingsFilePath () |
| Get path to user's custom mappings file. | |
| bool | addMappingPersistent (const QString &mapping) |
| Add a mapping and persist it to user's config file. | |
| bool | reloadMappings () |
| Reload all gamepad mappings. | |
| int | getInstanceIdFromPlayerIndex (int playerIndex) |
| Get instance ID from player index. | |
| QString | getNameForInstanceId (int instanceId) |
| Get device name for instance ID. | |
| QString | getPathForInstanceId (int instanceId) |
| Get device path for instance ID. | |
| QString | getGUIDForInstanceId (int instanceId) |
| Get GUID string for instance ID. | |
| int | getVendorForInstanceId (int instanceId) |
| Get vendor ID for instance ID. | |
| int | getProductForInstanceId (int instanceId) |
| Get product ID for instance ID. | |
| int | getProductVersionForInstanceId (int instanceId) |
| Get product version for instance ID. | |
| QString | getTypeForInstanceId (int instanceId) |
| Get gamepad type string for instance ID. | |
| QString | getRealTypeForInstanceId (int instanceId) |
| Get real (underlying) gamepad type string for instance ID. | |
| int | getPlayerIndexForInstanceId (int instanceId) |
| Get player index for instance ID. | |
| QString | getConnectionStateForInstanceId (int instanceId) |
| int | createVirtualJoystick (const QString &name, int axisCount, int buttonCount, int hatCount) |
| Create a virtual joystick. | |
| bool | destroyVirtualJoystick (int instanceId) |
| Destroy a virtual joystick. | |
| bool | isVirtualJoystick (int instanceId) |
| Check if a joystick is virtual. | |
| void | populateBindingResult (QVariantMap &result, const SDL_GamepadBinding *binding) |
| Populate a QVariantMap with binding information from SDL_GamepadBinding. | |
| template<typename MatchFunc > | |
| QVariantMap | findBinding (SDL_Gamepad *gamepad, MatchFunc matchFunc) |
Variables | |
| static QHash< int, QString > | s_virtualJoystickNames |
SDL joystick/gamepad utilities Joystick-specific SDL functionality
| bool SDLJoystick::addMapping | ( | const QString & | mapping | ) |
Add a single mapping string.
Definition at line 353 of file SDLJoystick.cc.
References addMapping().
Referenced by addMapping(), and addMappingPersistent().
| bool SDLJoystick::addMappingPersistent | ( | const QString & | mapping | ) |
Add a mapping and persist it to user's config file.
Definition at line 375 of file SDLJoystick.cc.
References addMapping(), addMappingPersistent(), and userMappingsFilePath().
Referenced by addMappingPersistent().
| int SDLJoystick::addMappingsFromFile | ( | const QString & | filePath | ) |
Add gamepad mappings from a file.
Definition at line 338 of file SDLJoystick.cc.
References addMappingsFromFile().
Referenced by addMappingsFromFile().
| QString SDLJoystick::connectionStateToString | ( | int | state | ) |
Connection state to string.
Definition at line 272 of file SDLJoystick.cc.
References connectionStateToString().
Referenced by connectionStateToString(), JoystickSDL::connectionType(), and getConnectionStateForInstanceId().
| int SDLJoystick::createVirtualJoystick | ( | const QString & | name, |
| int | axisCount, | ||
| int | buttonCount, | ||
| int | hatCount | ||
| ) |
Create a virtual joystick.
Definition at line 570 of file SDLJoystick.cc.
References createVirtualJoystick(), and s_virtualJoystickNames.
Referenced by createVirtualJoystick().
| bool SDLJoystick::destroyVirtualJoystick | ( | int | instanceId | ) |
Destroy a virtual joystick.
Definition at line 593 of file SDLJoystick.cc.
References destroyVirtualJoystick(), and s_virtualJoystickNames.
Referenced by destroyVirtualJoystick().
|
inline |
Find a gamepad binding matching the given predicate
| gamepad | The SDL gamepad to query |
| matchFunc | A callable that takes (const SDL_GamepadBinding*) and returns bool |
Definition at line 179 of file SDLJoystick.h.
References populateBindingResult().
Referenced by JoystickSDL::getAxisBinding(), and JoystickSDL::getButtonBinding().
| int SDLJoystick::gamepadAxisFromString | ( | const QString & | str | ) |
Definition at line 250 of file SDLJoystick.cc.
References gamepadAxisFromString().
Referenced by gamepadAxisFromString().
| QString SDLJoystick::gamepadAxisToString | ( | int | axis | ) |
Gamepad axis conversions.
Definition at line 244 of file SDLJoystick.cc.
References gamepadAxisToString().
Referenced by gamepadAxisToString().
| int SDLJoystick::gamepadButtonFromString | ( | const QString & | str | ) |
Definition at line 264 of file SDLJoystick.cc.
References gamepadButtonFromString().
Referenced by gamepadButtonFromString().
| QString SDLJoystick::gamepadButtonToString | ( | int | button | ) |
Gamepad button conversions.
Definition at line 258 of file SDLJoystick.cc.
References gamepadButtonToString().
Referenced by gamepadButtonToString().
| bool SDLJoystick::gamepadEventsEnabled | ( | ) |
Definition at line 169 of file SDLJoystick.cc.
References gamepadEventsEnabled().
Referenced by gamepadEventsEnabled().
| QString SDLJoystick::gamepadTypeDisplayName | ( | int | type | ) |
Definition at line 216 of file SDLJoystick.cc.
References gamepadTypeDisplayName().
Referenced by JoystickSDL::gamepadType(), gamepadTypeDisplayName(), and JoystickSDL::realGamepadType().
| int SDLJoystick::gamepadTypeFromString | ( | const QString & | str | ) |
Definition at line 208 of file SDLJoystick.cc.
References gamepadTypeFromString().
Referenced by gamepadTypeFromString().
| QString SDLJoystick::gamepadTypeToString | ( | int | type | ) |
Gamepad type conversions.
Definition at line 202 of file SDLJoystick.cc.
References gamepadTypeToString().
Referenced by gamepadTypeToString(), getRealTypeForInstanceId(), and getTypeForInstanceId().
| QString SDLJoystick::getConnectionStateForInstanceId | ( | int | instanceId | ) |
Get connection state for instance ID (Wired/Wireless/Unknown) Note: Requires the device to be opened first, returns "Invalid" otherwise
Definition at line 556 of file SDLJoystick.cc.
References connectionStateToString(), and getConnectionStateForInstanceId().
Referenced by getConnectionStateForInstanceId().
| QString SDLJoystick::getGUIDForInstanceId | ( | int | instanceId | ) |
Get GUID string for instance ID.
Definition at line 500 of file SDLJoystick.cc.
References getGUIDForInstanceId().
Referenced by getGUIDForInstanceId().
| QVariantMap SDLJoystick::getGUIDInfo | ( | const QString & | guid | ) |
Parse GUID info (vendor, product, version, crc16)
Definition at line 292 of file SDLJoystick.cc.
References getGUIDInfo().
Referenced by getGUIDInfo().
| int SDLJoystick::getInstanceIdFromPlayerIndex | ( | int | playerIndex | ) |
Get instance ID from player index.
Definition at line 454 of file SDLJoystick.cc.
References getInstanceIdFromPlayerIndex().
Referenced by getInstanceIdFromPlayerIndex().
| QString SDLJoystick::getMappingForGUID | ( | const QString & | guid | ) |
Get mapping string for a GUID.
Definition at line 318 of file SDLJoystick.cc.
References getMappingForGUID().
Referenced by getMappingForGUID().
| QString SDLJoystick::getNameForInstanceId | ( | int | instanceId | ) |
Get device name for instance ID.
Definition at line 475 of file SDLJoystick.cc.
References getNameForInstanceId(), and s_virtualJoystickNames.
Referenced by JoystickSDL::discover(), and getNameForInstanceId().
| QString SDLJoystick::getPathForInstanceId | ( | int | instanceId | ) |
Get device path for instance ID.
Definition at line 490 of file SDLJoystick.cc.
References getPathForInstanceId().
Referenced by getPathForInstanceId().
| int SDLJoystick::getPlayerIndexForInstanceId | ( | int | instanceId | ) |
Get player index for instance ID.
Definition at line 547 of file SDLJoystick.cc.
References getPlayerIndexForInstanceId().
Referenced by getPlayerIndexForInstanceId().
| int SDLJoystick::getProductForInstanceId | ( | int | instanceId | ) |
Get product ID for instance ID.
Definition at line 517 of file SDLJoystick.cc.
References getProductForInstanceId().
Referenced by getProductForInstanceId().
| int SDLJoystick::getProductVersionForInstanceId | ( | int | instanceId | ) |
Get product version for instance ID.
Definition at line 526 of file SDLJoystick.cc.
References getProductVersionForInstanceId().
Referenced by getProductVersionForInstanceId().
| QString SDLJoystick::getRealTypeForInstanceId | ( | int | instanceId | ) |
Get real (underlying) gamepad type string for instance ID.
Definition at line 541 of file SDLJoystick.cc.
References gamepadTypeToString(), and getRealTypeForInstanceId().
Referenced by getRealTypeForInstanceId().
| QString SDLJoystick::getTypeForInstanceId | ( | int | instanceId | ) |
Get gamepad type string for instance ID.
Definition at line 535 of file SDLJoystick.cc.
References gamepadTypeToString(), and getTypeForInstanceId().
Referenced by getTypeForInstanceId().
| int SDLJoystick::getVendorForInstanceId | ( | int | instanceId | ) |
Get vendor ID for instance ID.
Definition at line 508 of file SDLJoystick.cc.
References getVendorForInstanceId().
Referenced by getVendorForInstanceId().
| bool SDLJoystick::init | ( | ) |
Initialize SDL joystick/gamepad subsystems with QGC-specific hints.
Definition at line 64 of file SDLJoystick.cc.
References init(), and loadGamepadMappings().
Referenced by JoystickSDL::init(), and init().
| bool SDLJoystick::isInitialized | ( | ) |
Check if SDL joystick subsystem is initialized.
Definition at line 139 of file SDLJoystick.cc.
References isInitialized().
Referenced by isInitialized().
| bool SDLJoystick::isVirtualJoystick | ( | int | instanceId | ) |
Check if a joystick is virtual.
Definition at line 610 of file SDLJoystick.cc.
References isVirtualJoystick().
Referenced by isVirtualJoystick().
| bool SDLJoystick::joystickEventsEnabled | ( | ) |
Definition at line 159 of file SDLJoystick.cc.
References joystickEventsEnabled().
Referenced by joystickEventsEnabled().
|
static |
Definition at line 21 of file SDLJoystick.cc.
References loadGamepadMappings().
Referenced by init(), loadGamepadMappings(), and reloadMappings().
| void SDLJoystick::lockJoysticks | ( | ) |
Lock joystick access for thread-safe operations.
Definition at line 188 of file SDLJoystick.cc.
References lockJoysticks().
Referenced by SDLJoystick::JoystickLock::JoystickLock(), and lockJoysticks().
| void SDLJoystick::populateBindingResult | ( | QVariantMap & | result, |
| const SDL_GamepadBinding * | binding | ||
| ) |
Populate a QVariantMap with binding information from SDL_GamepadBinding.
Definition at line 619 of file SDLJoystick.cc.
References populateBindingResult().
Referenced by findBinding(), and populateBindingResult().
| void SDLJoystick::pumpEvents | ( | ) |
Pump SDL events (call periodically)
Definition at line 148 of file SDLJoystick.cc.
References pumpEvents().
Referenced by JoystickSDL::discover(), pumpEvents(), and Q_APPLICATION_STATIC().
| bool SDLJoystick::reloadMappings | ( | ) |
Reload all gamepad mappings.
Definition at line 437 of file SDLJoystick.cc.
References loadGamepadMappings(), and reloadMappings().
Referenced by reloadMappings().
| void SDLJoystick::setGamepadEventsEnabled | ( | bool | enabled | ) |
Enable/disable gamepad event processing.
Definition at line 164 of file SDLJoystick.cc.
References setGamepadEventsEnabled().
Referenced by setGamepadEventsEnabled().
| void SDLJoystick::setJoystickEventsEnabled | ( | bool | enabled | ) |
Enable/disable joystick event processing.
Definition at line 154 of file SDLJoystick.cc.
References setJoystickEventsEnabled().
Referenced by setJoystickEventsEnabled().
| void SDLJoystick::shutdown | ( | ) |
Shutdown SDL joystick/gamepad subsystems.
Definition at line 132 of file SDLJoystick.cc.
References s_virtualJoystickNames, and shutdown().
Referenced by shutdown(), and JoystickSDL::shutdown().
| void SDLJoystick::unlockJoysticks | ( | ) |
Definition at line 193 of file SDLJoystick.cc.
References unlockJoysticks().
Referenced by unlockJoysticks(), and SDLJoystick::JoystickLock::~JoystickLock().
| void SDLJoystick::updateGamepads | ( | ) |
Definition at line 179 of file SDLJoystick.cc.
References updateGamepads().
Referenced by updateGamepads().
| void SDLJoystick::updateJoysticks | ( | ) |
Update joystick/gamepad state.
Definition at line 174 of file SDLJoystick.cc.
References updateJoysticks().
Referenced by updateJoysticks().
| QString SDLJoystick::userMappingsFilePath | ( | ) |
Get path to user's custom mappings file.
Definition at line 369 of file SDLJoystick.cc.
References userMappingsFilePath().
Referenced by addMappingPersistent(), and userMappingsFilePath().
|
static |
Definition at line 19 of file SDLJoystick.cc.
Referenced by createVirtualJoystick(), destroyVirtualJoystick(), getNameForInstanceId(), and shutdown().