A gamepad device connected to a system 更多...
头: | #include <QGamepad> |
qmake: | QT += gamepad |
继承: | QObject |
|
|
QGamepad (int deviceId = 0, QObject * parent = nullptr) | |
~QGamepad () | |
double | axisLeftX () const |
double | axisLeftY () const |
double | axisRightX () const |
double | axisRightY () const |
bool | buttonL1 () const |
double | buttonL2 () const |
bool | buttonL3 () const |
bool | buttonR1 () const |
double | buttonR2 () const |
bool | buttonR3 () const |
bool | buttonA () const |
bool | buttonB () const |
bool | buttonCenter () const |
bool | buttonDown () const |
bool | buttonGuide () const |
bool | buttonLeft () const |
bool | buttonRight () const |
bool | buttonSelect () const |
bool | buttonStart () const |
bool | buttonUp () const |
bool | buttonX () const |
bool | buttonY () const |
int | deviceId () const |
bool | isConnected () const |
QString | name () const |
void | setDeviceId (int number ) |
void | axisLeftXChanged (double value ) |
void | axisLeftYChanged (double value ) |
void | axisRightXChanged (double value ) |
void | axisRightYChanged (double value ) |
void | buttonAChanged (bool value ) |
void | buttonBChanged (bool value ) |
void | buttonCenterChanged (bool value ) |
void | buttonDownChanged (bool value ) |
void | buttonGuideChanged (bool value ) |
void | buttonL1Changed (bool value ) |
void | buttonL2Changed (double value ) |
void | buttonL3Changed (bool value ) |
void | buttonLeftChanged (bool value ) |
void | buttonR1Changed (bool value ) |
void | buttonR2Changed (double value ) |
void | buttonR3Changed (bool value ) |
void | buttonRightChanged (bool value ) |
void | buttonSelectChanged (bool value ) |
void | buttonStartChanged (bool value ) |
void | buttonUpChanged (bool value ) |
void | buttonXChanged (bool value ) |
void | buttonYChanged (bool value ) |
void | connectedChanged (bool value ) |
void | deviceIdChanged (int value ) |
void | nameChanged (QString value ) |
A gamepad device connected to a system
QGamepad is used to access the current state of gamepad hardware connected to a system.
This read-only property holds the value of the left thumbstick's X axis. The axis values range from -1.0 to 1.0.
访问函数:
double | axisLeftX () const |
通知程序信号:
void | axisLeftXChanged (double value ) |
This read-only property holds the value of the left thumbstick's Y axis. The axis values range from -1.0 to 1.0.
访问函数:
double | axisLeftY () const |
通知程序信号:
void | axisLeftYChanged (double value ) |
This read-only property holds the value of the right thumbstick's X axis. The axis values range from -1.0 to 1.0.
访问函数:
double | axisRightX () const |
通知程序信号:
void | axisRightXChanged (double value ) |
This read-only property holds the value of the right thumbstick's Y axis. The axis values range from -1.0 to 1.0.
访问函数:
double | axisRightY () const |
通知程序信号:
void | axisRightYChanged (double value ) |
This read-only property holds the state of the left shoulder button. The value is
true
when pressed, and
false
when not pressed.
访问函数:
bool | buttonL1 () const |
通知程序信号:
void | buttonL1Changed (bool value ) |
This read-only property holds the value of the left trigger button. This trigger value ranges from 0.0 when not pressed to 1.0 when pressed completely.
访问函数:
double | buttonL2 () const |
通知程序信号:
void | buttonL2Changed (double value ) |
This read-only property holds the state of the left stick button. The value is
true
when pressed, and
false
when not pressed. This button is usually triggered by pressing the left joystick itself.
访问函数:
bool | buttonL3 () const |
通知程序信号:
void | buttonL3Changed (bool value ) |
This read-only property holds the state of the right shoulder button. The value is
true
when pressed, and
false
when not pressed.
访问函数:
bool | buttonR1 () const |
通知程序信号:
void | buttonR1Changed (bool value ) |
This read-only property holds the value of the right trigger button. This trigger value ranges from 0.0 when not pressed to 1.0 when pressed completely.
访问函数:
double | buttonR2 () const |
通知程序信号:
void | buttonR2Changed (double value ) |
This read-only property holds the state of the right stick button. The value is
true
when pressed, and
false
when not pressed. This button is usually triggered by pressing the right joystick itself.
访问函数:
bool | buttonR3 () const |
通知程序信号:
void | buttonR3Changed (bool value ) |
This read-only property holds the state of the A button. The value is
true
when pressed, and
false
when not pressed.
访问函数:
bool | buttonA () const |
通知程序信号:
void | buttonAChanged (bool value ) |
This read-only property holds the state of the B button. The value is
true
when pressed, and
false
when not pressed.
访问函数:
bool | buttonB () const |
通知程序信号:
void | buttonBChanged (bool value ) |
另请参阅 QGamepadManager::connectedGamepads ().
This read-only property holds the state of the center button. The value is
true
when pressed, and
false
when not pressed.
访问函数:
bool | buttonCenter () const |
通知程序信号:
void | buttonCenterChanged (bool value ) |
This read-only property holds the state of the direction pad down button. The value is
true
when pressed, and
false
when not pressed.
访问函数:
bool | buttonDown () const |
通知程序信号:
void | buttonDownChanged (bool value ) |
This read-only property holds the state of the guide button. The value is
true
when pressed, and
false
when not pressed. This button is typically the one in the center of the gamepad with a logo. Some gamepads will not have a guide button.
访问函数:
bool | buttonGuide () const |
通知程序信号:
void | buttonGuideChanged (bool value ) |
This read-only property holds the state of the direction pad left button. The value is
true
when pressed, and
false
when not pressed.
访问函数:
bool | buttonLeft () const |
通知程序信号:
void | buttonLeftChanged (bool value ) |
This read-only property holds the state of the direction pad right button. The value is
true
when pressed, and
false
when not pressed.
访问函数:
bool | buttonRight () const |
通知程序信号:
void | buttonRightChanged (bool value ) |
This read-only property holds the state of the Select button. The value is
true
when pressed, and
false
when not pressed. This button can sometimes be labeled as the Back button on some gamepads.
访问函数:
bool | buttonSelect () const |
通知程序信号:
void | buttonSelectChanged (bool value ) |
This read-only property holds the state of the Start button. The value is
true
when pressed, and
false
when not pressed. This button can sometimes be labeled as the Forward button on some gamepads.
访问函数:
bool | buttonStart () const |
通知程序信号:
void | buttonStartChanged (bool value ) |
This read-only property holds the state of the direction pad up button. The value is
true
when pressed, and
false
when not pressed.
访问函数:
bool | buttonUp () const |
通知程序信号:
void | buttonUpChanged (bool value ) |
This read-only property holds the state of the X button. The value is
true
when pressed, and
false
when not pressed.
访问函数:
bool | buttonX () const |
通知程序信号:
void | buttonXChanged (bool value ) |
This read-only property holds the state of the Y button. The value is
true
when pressed, and
false
when not pressed.
访问函数:
bool | buttonY () const |
通知程序信号:
void | buttonYChanged (bool value ) |
This read-only property holds the connectivity state of the gamepad device. If a gamepad is connected, this property will be true, otherwise false.
访问函数:
bool | isConnected () const |
通知程序信号:
void | connectedChanged (bool value ) |
This property holds the deviceId of the gamepad device. Multiple gamepad devices can be connected at any given time, so setting this property defines which gamepad to use.
访问函数:
int | deviceId () const |
void | setDeviceId (int number ) |
通知程序信号:
void | deviceIdChanged (int value ) |
另请参阅 QGamepadManager::connectedGamepads ().
This read-only property holds the reported name of the gamepad if one is available.
访问函数:
QString | name () const |
通知程序信号:
void | nameChanged (QString value ) |
构造 QGamepad 采用给定 deviceId and parent .
销毁 QGamepad .