Queries attached gamepads and related events. 更多...
头: | #include <QGamepadManager> |
qmake: | QT += gamepad |
实例化: | GamepadManager |
继承: | QObject |
flags | GamepadAxes |
flags | GamepadButtons |
const QList<int> | connectedGamepads () const |
QString | gamepadName (int deviceId ) const |
bool | isGamepadConnected (int deviceId ) const |
bool | configureAxis (int deviceId , QGamepadManager::GamepadAxis axis ) |
bool | configureButton (int deviceId , QGamepadManager::GamepadButton button ) |
bool | isConfigurationNeeded (int deviceId ) const |
void | resetConfiguration (int deviceId ) |
bool | setCancelConfigureButton (int deviceId , QGamepadManager::GamepadButton button ) |
void | setSettingsFile (const QString & file ) |
void | connectedGamepadsChanged () |
QGamepadManager * | instance () |
QGamepadManager provides a high-level interface for querying the attached gamepads and events related to all of the connected devices.
[slot]
bool
QGamepadManager::
configureAxis
(
int
deviceId
,
QGamepadManager::GamepadAxis
axis
)
Configures
axis
on the gamepad with the specified
deviceId
。返回
true
in case of success.
[slot]
bool
QGamepadManager::
configureButton
(
int
deviceId
,
QGamepadManager::GamepadButton
button
)
Configures the specified
button
on the gamepad with this
deviceId
。返回
true
in case of success.
[slot]
bool
QGamepadManager::
isConfigurationNeeded
(
int
deviceId
) const
Returns a boolean indicating whether configuration is needed for the specified deviceId .
[slot]
void
QGamepadManager::
resetConfiguration
(
int
deviceId
)
Resets the configuration on the gamepad with the specified deviceId .
[slot]
bool
QGamepadManager::
setCancelConfigureButton
(
int
deviceId
,
QGamepadManager::GamepadButton
button
)
Configures
button
as the cancel button on the gamepad with id
deviceId
。返回
true
in case of success.
[slot]
void
QGamepadManager::
setSettingsFile
(const
QString
&
file
)
Sets the name of the file that stores the button and axis configuration data.
Returns a list of integers containing the deviceId values of the connected gamepads.
注意: Getter function for property connectedGamepads.
Returns the name of the gamepad identified by deviceId 。若 deviceId does not identify a connected gamepad, returns an empty string.
该函数在 Qt 5.11 引入。
[static]
QGamepadManager
*QGamepadManager::
实例
()
Returns the instance of the QGamepadManager .
Returns a boolean indicating whether the gamepad with the specified deviceId is connected or not.