![]() |
AntiMicroX
|
Abstract class representing a hardware input device, e.g a joystick or controller. More...
#include <inputdevice.h>
Public Slots | |
void | reset () |
void | transferReset () |
Obtain current joystick element values, create new SetJoystick objects, and then transfer most recent joystick element values to new current set. More... | |
void | reInitButtons () |
void | resetButtonDownCount () |
void | setActiveSetNumber (int index) |
void | changeSetButtonAssociation (int button_index, int originset, int newset, int mode) |
void | changeSetAxisButtonAssociation (int button_index, int axis_index, int originset, int newset, int mode) |
void | changeSetStickButtonAssociation (int button_index, int stick_index, int originset, int newset, int mode) |
void | changeSetSensorButtonAssociation (JoySensorDirection direction, JoySensorType type, int originset, int newset, int mode) |
Creates reverse set change button mapping for toggle and while-hold set change mappings. More... | |
void | changeSetDPadButtonAssociation (int button_index, int dpad_index, int originset, int newset, int mode) |
void | changeSetVDPadButtonAssociation (int button_index, int dpad_index, int originset, int newset, int mode) |
void | setDeviceKeyPressTime (int newPressTime) |
void | profileEdited () |
void | setProfileName (QString value) |
void | haltServices () |
void | finalRemoval () |
virtual void | buttonClickEvent (int buttonindex) |
virtual void | buttonReleaseEvent (int buttonindex) |
virtual void | dpadButtonClickEvent (int buttonindex) |
virtual void | dpadButtonReleaseEvent (int buttonindex) |
void | establishPropertyUpdatedConnection () |
void | disconnectPropertyUpdatedConnection () |
Signals | |
void | setChangeActivated (int index) |
void | setAxisThrottleActivated (int index) |
void | clicked (int index) |
void | released (int index) |
void | rawButtonClick (int index) |
void | rawButtonRelease (int index) |
void | rawAxisButtonClick (int axis, int buttonindex) |
void | rawAxisButtonRelease (int axis, int buttonindex) |
void | rawDPadButtonClick (int dpad, int buttonindex) |
void | rawDPadButtonRelease (int dpad, int buttonindex) |
void | rawAxisActivated (int axis, int value) |
void | rawAxisReleased (int axis, int value) |
void | rawAxisMoved (int axis, int value) |
void | profileUpdated () |
void | propertyUpdated () |
void | profileNameEdited (QString text) |
void | requestProfileLoad (QString location) |
void | requestWait () |
Public Member Functions | |
InputDevice (SDL_Joystick *joystick, int deviceIndex, AntiMicroSettings *settings, QObject *parent) | |
virtual | ~InputDevice () |
virtual int | getNumberButtons () |
virtual int | getNumberAxes () |
virtual int | getNumberHats () |
virtual int | getNumberSticks () |
virtual bool | hasSensor (JoySensorType type) |
Checks if this input device has a sensor of given type. More... | |
virtual int | getNumberVDPads () |
int | getJoyNumber () |
int | getRealJoyNumber () |
int | getActiveSetNumber () |
SetJoystick * | getActiveSetJoystick () |
SetJoystick * | getSetJoystick (int index) |
void | removeControlStick (int index) |
bool | isActive () |
int | getButtonDownCount () |
virtual QString | getXmlName () const =0 |
virtual QString | getName ()=0 |
virtual QString | getSDLName ()=0 |
virtual QString | getDescription () |
virtual QString | getGUIDString () const =0 |
virtual QString | getUniqueIDString () const =0 |
virtual QString | getVendorString () const =0 |
virtual QString | getSerialString () const =0 |
virtual QString | getProductIDString () const =0 |
virtual QString | getProductVersion () const =0 |
virtual QString | getRawGUIDString () const |
virtual QString | getRawVendorString () const |
virtual QString | getRawProductIDString () const |
virtual QString | getRawProductVersion () const |
virtual QString | getRawUniqueIDString () const |
virtual void | setCounterUniques (int counter)=0 |
virtual QString | getStringIdentifier () |
virtual void | closeSDLDevice ()=0 |
virtual SDL_JoystickID | getSDLJoystickID ()=0 |
QString | getSDLPlatform () |
virtual bool | isGameController () |
Check if device is using the SDL Game Controller API. More... | |
virtual bool | isKnownController () |
void | setButtonName (int index, QString tempName) |
void | setAxisButtonName (int axisIndex, int buttonIndex, QString tempName) |
void | setStickButtonName (int stickIndex, int buttonIndex, QString tempName) |
void | setSensorButtonName (JoySensorType type, JoySensorDirection direction, QString tempName) |
Sets the name of a mapped sensor button in all sets Used during XML loading. More... | |
void | setDPadButtonName (int dpadIndex, int buttonIndex, QString tempName) |
void | setVDPadButtonName (int vdpadIndex, int buttonIndex, QString tempName) |
void | setAxisName (int axisIndex, QString tempName) |
void | setStickName (int stickIndex, QString tempName) |
void | setSensorName (JoySensorType type, QString tempName) |
Sets the name of a sensor in all sets Used during XML loading. More... | |
void | setDPadName (int dpadIndex, QString tempName) |
void | setVDPadName (int vdpadIndex, QString tempName) |
virtual int | getNumberRawButtons ()=0 |
virtual int | getNumberRawAxes ()=0 |
virtual int | getNumberRawHats ()=0 |
virtual double | getRawSensorRate (JoySensorType type)=0 |
virtual bool | hasRawSensor (JoySensorType type)=0 |
int | getDeviceKeyPressTime () |
void | setIndex (int index) |
bool | isDeviceEdited () |
void | revertProfileEdited () |
void | setKeyRepeatStatus (bool enabled) |
void | setKeyRepeatDelay (int delay) |
void | setKeyRepeatRate (int rate) |
bool | isKeyRepeatEnabled () |
int | getKeyRepeatDelay () |
int | getKeyRepeatRate () |
QString | getProfileName () |
bool | hasCalibrationThrottle (int axisNum) |
JoyAxis::ThrottleTypes | getCalibrationThrottle (int axisNum) |
void | setCalibrationThrottle (int axisNum, JoyAxis::ThrottleTypes throttle) |
void | setCalibrationStatus (int axisNum, JoyAxis::ThrottleTypes throttle) |
void | removeCalibrationStatus (int axisNum) |
void | sendLoadProfileRequest (QString location) |
AntiMicroSettings * | getSettings () |
void | activatePossiblePendingEvents () |
void | activatePossibleControlStickEvents () |
void | activatePossibleAxisEvents () |
void | activatePossibleSensorEvents () |
void | activatePossibleDPadEvents () |
void | activatePossibleVDPadEvents () |
void | activatePossibleButtonEvents () |
void | convertToUniqueMappSett (QSettings *sett, QString gUIDmappGroupSett, QString uniqueIDGroupSett) |
bool | isEmptyUniqueID (QString tempUniqueID) |
Check if the GUID passed is considered empty. More... | |
bool | isRelevantUniqueID (QString tempUniqueID) |
Check if GUID passed matches the expected GUID for a device. Needed for xinput GUID abstraction. More... | |
void | setRawAxisDeadZone (int deadZone) |
int | getRawAxisDeadZone () |
void | rawAxisEvent (int index, int value) |
bool | elementsHaveNames () |
QMap< int, SetJoystick * > & | getJoystick_sets () |
SDL_Joystick * | getJoyHandle () const |
virtual SDL_GameControllerType | getControllerType () const |
Returns the current controller model. For non gamecontroller devices it always returns UNKNOWN. More... | |
InputDeviceCalibration * | getCalibrationBackend () |
Returns a pointer to the internal calibration storage backend. More... | |
void | updateStickCalibration (int index, double offsetX, double gainX, double offsetY, double gainY) |
Updates stored calibration for this controller and applies calibration to the specified stick in all sets See JoyControlStick::setCalibration. More... | |
void | applyStickCalibration (int index, double offsetX, double gainX, double offsetY, double gainY) |
Applies calibration to the specified stick in all sets See JoyControlStick::setCalibration. More... | |
void | updateAccelerometerCalibration (double offsetX, double offsetY, double offsetZ) |
Applies calibration to the specified accelerometer in all sets See JoySensor::setCalibration. More... | |
void | applyAccelerometerCalibration (double offsetX, double offsetY, double offsetZ) |
Applies calibration to the specified accelerometer in all sets See JoySensor::setCalibration. More... | |
void | updateGyroscopeCalibration (double offsetX, double offsetY, double offsetZ) |
Updates stored calibration for this controller and applies calibration to the specified gyroscope in all sets See JoySensor::setCalibration. More... | |
void | applyGyroscopeCalibration (double offsetX, double offsetY, double offsetZ) |
Applies calibration to the specified gyroscope in all sets See JoySensor::setCalibration. More... | |
Protected Slots | |
void | propogateSetChange (int index) |
void | propogateSetAxisThrottleChange (int index, int originset) |
void | buttonDownEvent (int setindex, int buttonindex) |
void | buttonUpEvent (int setindex, int buttonindex) |
virtual void | axisActivatedEvent (int setindex, int axisindex, int value) |
virtual void | axisReleasedEvent (int setindex, int axisindex, int value) |
virtual void | axisButtonDownEvent (int setindex, int axisindex, int buttonindex) |
virtual void | axisButtonUpEvent (int setindex, int axisindex, int buttonindex) |
virtual void | dpadButtonDownEvent (int setindex, int dpadindex, int buttonindex) |
virtual void | dpadButtonUpEvent (int setindex, int dpadindex, int buttonindex) |
virtual void | stickButtonDownEvent (int setindex, int stickindex, int buttonindex) |
virtual void | stickButtonUpEvent (int setindex, int stickindex, int buttonindex) |
virtual void | sensorButtonDownEvent (int setindex, JoySensorType type, JoySensorDirection direction) |
virtual void | sensorButtonUpEvent (int setindex, JoySensorType type, JoySensorDirection direction) |
void | updateSetButtonNames (int index) |
void | updateSetAxisButtonNames (int axisIndex, int buttonIndex) |
void | updateSetStickButtonNames (int stickIndex, int buttonIndex) |
void | updateSetSensorButtonNames (JoySensorType type, JoySensorDirection direction) |
Rename mapped sensor button in all sets to the name in the active set. More... | |
void | updateSetDPadButtonNames (int dpadIndex, int buttonIndex) |
void | updateSetVDPadButtonNames (int vdpadIndex, int buttonIndex) |
void | updateSetAxisNames (int axisIndex) |
void | updateSetStickNames (int stickIndex) |
void | updateSetSensorNames (JoySensorType type) |
Rename sensor in all sets to the name in the current set. More... | |
void | updateSetDPadNames (int dpadIndex) |
void | updateSetVDPadNames (int vdpadIndex) |
Protected Member Functions | |
void | enableSetConnections (SetJoystick *setstick) |
Establishes necessary connections for set change slots. More... | |
QHash< int, JoyAxis::ThrottleTypes > & | getCali () |
SDL_JoystickID * | getJoystickID () |
Protected Attributes | |
int | rawAxisDeadZone |
int | keyPressTime |
QString | profileName |
InputDeviceCalibration | m_calibrations |
Private Member Functions | |
QList< bool > & | getButtonstatesLocal () |
QList< int > & | getAxesstatesLocal () |
QList< int > & | getDpadstatesLocal () |
Private Attributes | |
SDL_Joystick * | m_joyhandle |
QMap< int, SetJoystick * > | joystick_sets |
QHash< int, JoyAxis::ThrottleTypes > | cali |
AntiMicroSettings * | m_settings |
int | active_set |
int | joyNumber |
int | buttonDownCount |
SDL_JoystickID | joystickID |
bool | deviceEdited |
bool | keyRepeatEnabled |
int | keyRepeatDelay |
int | keyRepeatRate |
QList< bool > | buttonstates |
QList< int > | axesstates |
QList< int > | dpadstates |
Abstract class representing a hardware input device, e.g a joystick or controller.
Two concrete implementations are Joystick and class GameController difference between two of them are described in listed sources
|
explicit |
|
virtual |
void InputDevice::activatePossibleAxisEvents | ( | ) |
void InputDevice::activatePossibleButtonEvents | ( | ) |
void InputDevice::activatePossibleControlStickEvents | ( | ) |
void InputDevice::activatePossibleDPadEvents | ( | ) |
void InputDevice::activatePossiblePendingEvents | ( | ) |
void InputDevice::activatePossibleSensorEvents | ( | ) |
void InputDevice::activatePossibleVDPadEvents | ( | ) |
void InputDevice::applyAccelerometerCalibration | ( | double | offsetX, |
double | offsetY, | ||
double | offsetZ | ||
) |
Applies calibration to the specified accelerometer in all sets See JoySensor::setCalibration.
[in] | offsetX | Offset angle around the X axis |
[in] | offsetY | Offset angle around the Y axis |
[in] | offsetZ | Offset angle around the Z axis |
void InputDevice::applyGyroscopeCalibration | ( | double | offsetX, |
double | offsetY, | ||
double | offsetZ | ||
) |
Applies calibration to the specified gyroscope in all sets See JoySensor::setCalibration.
[in] | offsetX | Offset value for X axis |
[in] | offsetY | Offset value for Y axis |
[in] | offsetZ | Offset value for Z axis |
void InputDevice::applyStickCalibration | ( | int | index, |
double | offsetX, | ||
double | gainX, | ||
double | offsetY, | ||
double | gainY | ||
) |
Applies calibration to the specified stick in all sets See JoyControlStick::setCalibration.
[in] | index | Stick index |
[in] | offsetX | Offset value for X axis |
[in] | gainX | Gain value for X axis |
[in] | offsetY | Offset value for Y axis |
[in] | gainY | Gain value for Y axis |
|
protectedvirtualslot |
|
protectedvirtualslot |
|
protectedvirtualslot |
|
protectedvirtualslot |
|
virtualslot |
|
protectedslot |
|
virtualslot |
|
protectedslot |
|
slot |
|
slot |
|
slot |
|
slot |
Creates reverse set change button mapping for toggle and while-hold set change mappings.
|
slot |
|
slot |
|
signal |
|
pure virtual |
void InputDevice::convertToUniqueMappSett | ( | QSettings * | sett, |
QString | gUIDmappGroupSett, | ||
QString | uniqueIDGroupSett | ||
) |
|
slot |
|
virtualslot |
|
protectedvirtualslot |
|
virtualslot |
|
protectedvirtualslot |
bool InputDevice::elementsHaveNames | ( | ) |
|
protected |
Establishes necessary connections for set change slots.
|
slot |
|
slot |
SetJoystick * InputDevice::getActiveSetJoystick | ( | ) |
int InputDevice::getActiveSetNumber | ( | ) |
|
private |
int InputDevice::getButtonDownCount | ( | ) |
|
private |
|
protected |
InputDeviceCalibration * InputDevice::getCalibrationBackend | ( | ) |
Returns a pointer to the internal calibration storage backend.
JoyAxis::ThrottleTypes InputDevice::getCalibrationThrottle | ( | int | axisNum | ) |
|
virtual |
Returns the current controller model. For non gamecontroller devices it always returns UNKNOWN.
Reimplemented in GameController.
|
virtual |
int InputDevice::getDeviceKeyPressTime | ( | ) |
|
private |
|
pure virtual |
SDL_Joystick * InputDevice::getJoyHandle | ( | ) | const |
int InputDevice::getJoyNumber | ( | ) |
QMap< int, SetJoystick * > & InputDevice::getJoystick_sets | ( | ) |
|
protected |
int InputDevice::getKeyRepeatDelay | ( | ) |
int InputDevice::getKeyRepeatRate | ( | ) |
|
pure virtual |
|
virtual |
|
virtual |
|
virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
virtual |
|
virtual |
|
pure virtual |
|
pure virtual |
QString InputDevice::getProfileName | ( | ) |
int InputDevice::getRawAxisDeadZone | ( | ) |
|
virtual |
|
virtual |
|
virtual |
|
pure virtual |
Implemented in GameController, and Joystick.
|
virtual |
|
virtual |
int InputDevice::getRealJoyNumber | ( | ) |
|
pure virtual |
|
pure virtual |
QString InputDevice::getSDLPlatform | ( | ) |
|
pure virtual |
SetJoystick * InputDevice::getSetJoystick | ( | int | index | ) |
AntiMicroSettings * InputDevice::getSettings | ( | ) |
|
virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
slot |
bool InputDevice::hasCalibrationThrottle | ( | int | axisNum | ) |
|
pure virtual |
|
virtual |
Checks if this input device has a sensor of given type.
bool InputDevice::isActive | ( | ) |
bool InputDevice::isDeviceEdited | ( | ) |
bool InputDevice::isEmptyUniqueID | ( | QString | tempUniqueID | ) |
Check if the GUID passed is considered empty.
GUID | string |
|
virtual |
Check if device is using the SDL Game Controller API.
Reimplemented in GameController.
bool InputDevice::isKeyRepeatEnabled | ( | ) |
|
virtual |
bool InputDevice::isRelevantUniqueID | ( | QString | tempUniqueID | ) |
Check if GUID passed matches the expected GUID for a device. Needed for xinput GUID abstraction.
GUID | string |
|
slot |
|
signal |
|
signal |
|
signal |
|
protectedslot |
|
protectedslot |
|
signal |
|
signal |
|
signal |
void InputDevice::rawAxisEvent | ( | int | index, |
int | value | ||
) |
|
signal |
|
signal |
|
signal |
|
signal |
|
signal |
|
signal |
|
slot |
|
signal |
void InputDevice::removeCalibrationStatus | ( | int | axisNum | ) |
void InputDevice::removeControlStick | ( | int | index | ) |
|
signal |
|
signal |
|
slot |
|
slot |
void InputDevice::revertProfileEdited | ( | ) |
void InputDevice::sendLoadProfileRequest | ( | QString | location | ) |
|
protectedvirtualslot |
|
protectedvirtualslot |
|
slot |
void InputDevice::setAxisButtonName | ( | int | axisIndex, |
int | buttonIndex, | ||
QString | tempName | ||
) |
void InputDevice::setAxisName | ( | int | axisIndex, |
QString | tempName | ||
) |
|
signal |
void InputDevice::setButtonName | ( | int | index, |
QString | tempName | ||
) |
void InputDevice::setCalibrationStatus | ( | int | axisNum, |
JoyAxis::ThrottleTypes | throttle | ||
) |
void InputDevice::setCalibrationThrottle | ( | int | axisNum, |
JoyAxis::ThrottleTypes | throttle | ||
) |
|
signal |
|
pure virtual |
|
slot |
void InputDevice::setDPadButtonName | ( | int | dpadIndex, |
int | buttonIndex, | ||
QString | tempName | ||
) |
void InputDevice::setDPadName | ( | int | dpadIndex, |
QString | tempName | ||
) |
void InputDevice::setIndex | ( | int | index | ) |
void InputDevice::setKeyRepeatDelay | ( | int | delay | ) |
void InputDevice::setKeyRepeatRate | ( | int | rate | ) |
void InputDevice::setKeyRepeatStatus | ( | bool | enabled | ) |
|
slot |
void InputDevice::setRawAxisDeadZone | ( | int | deadZone | ) |
void InputDevice::setSensorButtonName | ( | JoySensorType | type, |
JoySensorDirection | direction, | ||
QString | tempName | ||
) |
Sets the name of a mapped sensor button in all sets Used during XML loading.
type | The sensor type which has the to be renamed button |
direction | The direction of the to be renamed button |
tempName | The new name |
void InputDevice::setSensorName | ( | JoySensorType | type, |
QString | tempName | ||
) |
Sets the name of a sensor in all sets Used during XML loading.
type | The sensor type to be renamed |
tempName | The new name |
void InputDevice::setStickButtonName | ( | int | stickIndex, |
int | buttonIndex, | ||
QString | tempName | ||
) |
void InputDevice::setStickName | ( | int | stickIndex, |
QString | tempName | ||
) |
void InputDevice::setVDPadButtonName | ( | int | vdpadIndex, |
int | buttonIndex, | ||
QString | tempName | ||
) |
void InputDevice::setVDPadName | ( | int | vdpadIndex, |
QString | tempName | ||
) |
|
protectedvirtualslot |
|
protectedvirtualslot |
|
slot |
Obtain current joystick element values, create new SetJoystick objects, and then transfer most recent joystick element values to new current set.
void InputDevice::updateAccelerometerCalibration | ( | double | offsetX, |
double | offsetY, | ||
double | offsetZ | ||
) |
Applies calibration to the specified accelerometer in all sets See JoySensor::setCalibration.
[in] | offsetX | Offset angle around the X axis |
[in] | offsetY | Offset angle around the Y axis |
[in] | offsetZ | Offset angle around the Z axis |
void InputDevice::updateGyroscopeCalibration | ( | double | offsetX, |
double | offsetY, | ||
double | offsetZ | ||
) |
Updates stored calibration for this controller and applies calibration to the specified gyroscope in all sets See JoySensor::setCalibration.
[in] | offsetX | Offset value for X axis |
[in] | offsetY | Offset value for Y axis |
[in] | offsetZ | Offset value for Z axis |
|
protectedslot |
|
protectedslot |
|
protectedslot |
|
protectedslot |
|
protectedslot |
|
protectedslot |
Rename mapped sensor button in all sets to the name in the active set.
type | The sensor type which has the to be renamed button |
direction | The direction of the to be renamed button |
|
protectedslot |
Rename sensor in all sets to the name in the current set.
type | The sensor to rename |
|
protectedslot |
|
protectedslot |
|
protectedslot |
|
protectedslot |
void InputDevice::updateStickCalibration | ( | int | index, |
double | offsetX, | ||
double | gainX, | ||
double | offsetY, | ||
double | gainY | ||
) |
Updates stored calibration for this controller and applies calibration to the specified stick in all sets See JoyControlStick::setCalibration.
[in] | index | Stick index |
[in] | offsetX | Offset value for X axis |
[in] | gainX | Gain value for X axis |
[in] | offsetY | Offset value for Y axis |
[in] | gainY | Gain value for Y axis |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
protected |
|
private |
|
private |
|
private |
|
protected |
|
private |
|
private |
|
protected |
|
protected |