QGamepadManager Class

Queries attached gamepads and related events. 更多...

头: #include <QGamepadManager>
qmake: QT += gamepad
继承: QObject

公共类型

flags GamepadAxes
enum GamepadAxis { AxisInvalid, AxisLeftX, AxisLeftY, AxisRightX, AxisRightY }
enum GamepadButton { ButtonInvalid, ButtonA, ButtonB, ButtonX, ..., ButtonGuide }
flags GamepadButtons

特性

公共函数

const QList<int> connectedGamepads () const
bool isGamepadConnected (int deviceId ) const

公共槽

bool configureAxis (int deviceId , GamepadAxis axis )
bool configureButton (int deviceId , GamepadButton button )
bool isConfigurationNeeded (int deviceId ) const
void resetConfiguration (int deviceId )
bool setCancelConfigureButton (int deviceId , GamepadButton button )
void setSettingsFile (const QString & file )

信号

void axisConfigured (int deviceId , QGamepadManager::GamepadAxis axis )
void buttonConfigured (int deviceId , QGamepadManager::GamepadButton button )
void configurationCanceled (int deviceId )
void connectedGamepadsChanged ()
void gamepadAxisEvent (int deviceId , QGamepadManager::GamepadAxis axis , double value )
void gamepadButtonPressEvent (int deviceId , QGamepadManager::GamepadButton button , double value )
void gamepadButtonReleaseEvent (int deviceId , QGamepadManager::GamepadButton button )
void gamepadConnected (int deviceId )
void gamepadDisconnected (int deviceId )

静态公共成员

QGamepadManager * instance ()

额外继承成员

详细描述

Queries attached gamepads and related events.

QGamepadManager provides a high-level interface for querying the attached gamepads and events related to all of the connected devices.

成员类型文档编制

enum QGamepadManager:: GamepadAxis
flags QGamepadManager:: GamepadAxes

The GamepadAxes type is a typedef for QFlags <GamepadAxis>. It stores an OR combination of GamepadAxis values.

enum QGamepadManager:: GamepadButton
flags QGamepadManager:: GamepadButtons

The GamepadButtons type is a typedef for QFlags <GamepadButton>. It stores an OR combination of GamepadButton values.

特性文档编制

connectedGamepads : const QList < int >

访问函数:

const QList<int> connectedGamepads () const

通知程序信号:

void connectedGamepadsChanged ()

成员函数文档编制

[signal] void QGamepadManager:: axisConfigured ( int deviceId , QGamepadManager::GamepadAxis axis )

[signal] void QGamepadManager:: buttonConfigured ( int deviceId , QGamepadManager::GamepadButton button )

[signal] void QGamepadManager:: configurationCanceled ( int deviceId )

[slot] bool QGamepadManager:: configureAxis ( int deviceId , GamepadAxis axis )

Configures axis on the gamepad with the specified deviceId 。返回 true in case of success.

[slot] bool QGamepadManager:: configureButton ( int deviceId , GamepadButton button )

Configures the specified button on the gamepad with this deviceId 。返回 true in case of success.

const QList < int > QGamepadManager:: connectedGamepads () const

返回 QList containing the deviceId values of the connected gamepads.

注意: Getter 函数对于特性 connectedGamepads .

[signal] void QGamepadManager:: gamepadAxisEvent ( int deviceId , QGamepadManager::GamepadAxis axis , double value )

[signal] void QGamepadManager:: gamepadButtonPressEvent ( int deviceId , QGamepadManager::GamepadButton button , double value )

[signal] void QGamepadManager:: gamepadButtonReleaseEvent ( int deviceId , QGamepadManager::GamepadButton button )

[signal] void QGamepadManager:: gamepadConnected ( int deviceId )

[signal] void QGamepadManager:: gamepadDisconnected ( int deviceId )

[static] QGamepadManager *QGamepadManager:: instance ()

Returns the instance of the QGamepadManager .

[slot] bool QGamepadManager:: isConfigurationNeeded ( int deviceId ) const

Returns a boolean indicating whether configuration is needed for the specified deviceId .

bool QGamepadManager:: isGamepadConnected ( int deviceId ) const

Returns a boolean indicating whether the gamepad with the specified deviceId is connected or not.

[slot] void QGamepadManager:: resetConfiguration ( int deviceId )

Resets the configuration on the gamepad with the specified deviceId .

[slot] bool QGamepadManager:: setCancelConfigureButton ( int deviceId , 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.