 |
AntiMicroX
|
Go to the documentation of this file.
19 #ifndef JOYCONTROLSTICK_H
20 #define JOYCONTROLSTICK_H
30 class QXmlStreamReader;
31 class QXmlStreamWriter;
53 void joyEvent(
bool ignoresets =
false);
71 void getCalibration(
double *offsetX,
double *gainX,
double *offsetY,
double *gainY)
const;
72 void setCalibration(
double offsetX,
double gainX,
double offsetY,
double gainY);
112 virtual QString
getName(
bool forceFullFormat =
false,
bool displayNames =
false);
113 virtual QString
getPartialName(
bool forceFullFormat =
false,
bool displayNames =
false);
120 QHash<JoyStickDirections, JoyControlStickButton *> *
getButtons();
175 QHash<JoyStickDirections, JoyControlStickButton *>
186 virtual void readConfig(QXmlStreamReader *xml);
229 bool interpolate =
false);
233 bool interpolate =
false);
246 void moved(
int xaxis,
int yaxis);
247 void active(
int xaxis,
int yaxis);
308 QHash<JoyStickDirections, JoyControlStickButton *>
buttons;
314 #endif // JOYCONTROLSTICK_H
QHash< JoyStickDirections, JoyControlStickButton * > * getButtons()
Definition: joycontrolstick.cpp:1820
double calculateXDiagonalDeadZone(int axisXValue, int axisYValue)
Definition: joycontrolstick.cpp:3660
JoyAxis * getAxisY()
Definition: joycontrolstick.cpp:1824
QPointer< JoyAxis > axisX
Definition: joycontrolstick.h:293
double getNormalizedAbsoluteDistance()
Definition: joycontrolstick.cpp:707
bool hasSameButtonsMouseMode()
Definition: joycontrolstick.cpp:1918
void diagonalRangeChanged(int value)
virtual QString getName(bool forceFullFormat=false, bool displayNames=false)
Definition: joycontrolstick.cpp:747
void joyEvent(bool ignoresets=false)
Take the input value for the two axes that make up a stick and activate the proper event based on the...
Definition: joycontrolstick.cpp:72
@ StickUp
Definition: joycontrolstickdirectionstype.h:28
static const int AXISMAXZONE
Definition: globalvariables.h:120
JoyControlStickModifierButton * modifierButton
Definition: joycontrolstick.h:309
bool inDeadZone()
Check the current stick position to see if it lies in the assigned dead zone.
Definition: joycontrolstick.cpp:144
void setButtonsExtraAccelerationStatus(bool enabled)
Definition: joycontrolstick.cpp:2845
double calculateAccelerationDistance(JoyControlStickButton *button)
Definition: joycontrolstick.cpp:3146
void activatePendingEvent()
Definition: joycontrolstick.cpp:2832
void getCalibration(double *offsetX, double *gainX, double *offsetY, double *gainY) const
Reads the calibration values of both stick axes.
Definition: joycontrolstick.cpp:946
Represents single axis of of joystick (or other input)
Definition: joyaxis.h:40
double getButtonsPresetSensitivity()
Definition: joycontrolstick.cpp:2129
int getDeadZone()
Get the assigned dead zone value.
Definition: joycontrolstick.cpp:192
void setButtonsMinAccelerationThreshold(double value)
Definition: joycontrolstick.cpp:2972
virtual void populateButtons()
Populate the virtual buttons assigned to an analog stick.
Definition: joycontrolstick.cpp:157
QString getStickName()
Definition: joycontrolstick.cpp:2190
void resetButtons()
Reset all the properties of the stick direction buttons and the stick modifier button.
Definition: joycontrolstick.cpp:1156
static const double PI
Definition: globalvariables.h:214
void setDiagonalRange(int value)
Set the diagonal range value for a stick.
Definition: joycontrolstick.cpp:970
void setButtonsExtraAccelCurve(JoyButton::JoyExtraAccelerationCurve curve)
Definition: joycontrolstick.cpp:3838
static const int DEFAULTDEADZONE
Definition: globalvariables.h:217
int calculateCircleYValue(int axisXValue, int axisYValue)
Definition: joycontrolstick.cpp:1727
int diagonalRange
Definition: joycontrolstick.h:282
SetJoystick * getParentSet()
Get pointer to the set that a stick belongs to.
Definition: joycontrolstick.cpp:2218
void active(int xaxis, int yaxis)
JoyControlStickButton * activeButton3
Definition: joycontrolstick.h:298
void setButtonsAccelerationExtraDuration(double value)
Definition: joycontrolstick.cpp:3060
QHash< JoyStickDirections, JoyControlStickButton * > buttons
Definition: joycontrolstick.h:308
JoyButton::JoyMouseCurve getButtonsPresetMouseCurve()
Definition: joycontrolstick.cpp:2013
bool isActive
Definition: joycontrolstick.h:289
void modifierZoneChanged(int value)
JoyButton::JoyExtraAccelerationCurve getButtonsExtraAccelerationCurve()
Definition: joycontrolstick.cpp:3851
int getXCoordinate()
Get the value for the corresponding X axis.
Definition: joycontrolstick.cpp:1674
double calculateYDistanceFromDeadZone(bool interpolate=false)
Get distance of the Y axis past the assigned dead zone.
Definition: joycontrolstick.cpp:432
JoyButton::JoyMouseMovementMode getButtonsPresetMouseMode()
Definition: joycontrolstick.cpp:1947
void clearPendingAxisEvents()
QList< double > getDiagonalZoneAngles()
Definition: joycontrolstick.cpp:1750
JoyControlStick::JoyStickDirections determineStandardModeDirection()
Find the current stick direction based on a Standard mode stick.
Definition: joycontrolstick.cpp:2446
int getMaxZone()
Definition: joycontrolstick.cpp:832
int deadZone
Definition: joycontrolstick.h:279
void setButtonsStartAccelerationMultiplier(double value)
Definition: joycontrolstick.cpp:2928
void populateStickBtns()
Definition: joycontrolstick.cpp:159
void setDirButtonsUpdateInitAccel(JoyControlStick::JoyStickDirections direction, bool state)
Definition: joycontrolstick.cpp:3881
A set of mapped events which can by switched by a controller event. Contains controller input objects...
Definition: setjoystick.h:39
void setButtonsSensitivity(double value)
Definition: joycontrolstick.cpp:2118
int stickDelay
Definition: joycontrolstick.h:285
JoyControlStick::JoyStickDirections calculateStickDirection()
Calculate the current direction of the stick based on the values of the X and Y axes and the current ...
Definition: joycontrolstick.cpp:2592
void setButtonsMaxAccelerationThreshold(double value)
Definition: joycontrolstick.cpp:3016
double calculateLastDirectionalDistance()
Definition: joycontrolstick.cpp:1464
int getCurrentlyAssignedSet()
Definition: joycontrolstick.cpp:845
double calculateEightWayDiagonalDistanceFromDeadZone()
Definition: joycontrolstick.cpp:3623
double calculateDirectionalDistance()
Used to calculate the distance value that should be used for keyboard events and distance slots.
Definition: joycontrolstick.cpp:1619
double getAbsoluteRawDistance()
Get the raw radial distance of the stick. Values will be between 0 - 32,767.
Definition: joycontrolstick.cpp:691
void released(int axis, int yaxis)
void setStickDelay(int value)
Definition: joycontrolstick.cpp:2771
int getButtonsPresetSpringWidth()
Definition: joycontrolstick.cpp:2062
virtual bool isDefault()
Definition: joycontrolstick.cpp:1881
void setButtonsMouseMode(JoyButton::JoyMouseMovementMode mode)
Definition: joycontrolstick.cpp:1907
void determineFourWayCardinalEvent(JoyControlStickButton *&eventbutton1, JoyControlStickButton *&eventbutton2)
Determine which cardinal stick direction button should be active when using a four way cardinal stick...
Definition: joycontrolstick.cpp:2378
virtual QString getDefaultStickName()
Definition: joycontrolstick.cpp:830
double calculateLastAccelerationButtonDistance(JoyControlStickButton *button)
Definition: joycontrolstick.cpp:3373
void moved(int xaxis, int yaxis)
JoyAxis * getAxisX()
Definition: joycontrolstick.cpp:1822
JoyControlStick::JoyStickDirections determineEightWayModeDirection()
Find the current stick direction based on a Eight Way mode stick.
Definition: joycontrolstick.cpp:2501
double getButtonsExtraAccelerationMultiplier()
Definition: joycontrolstick.cpp:2897
void performButtonPress(JoyControlStickButton *eventbutton, JoyControlStickButton *&activebutton, bool ignoresets)
Activate a stick direction button.
Definition: joycontrolstick.cpp:2236
int m_modifier_zone
Definition: joycontrolstick.h:280
QHash< JoyStickDirections, JoyControlStickButton * > getButtonsForDirection(JoyControlStick::JoyStickDirections direction)
Definition: joycontrolstick.cpp:3899
JoyControlStick::JoyStickDirections determineFourWayDiagonalDirection()
Find the current stick direction based on a Four Way Diagonal mode stick.
Definition: joycontrolstick.cpp:2555
double calculateXDistanceFromDeadZone(bool interpolate=false)
Get distance of the X axis past the assigned dead zone.
Definition: joycontrolstick.cpp:562
bool pendingStickEvent
Definition: joycontrolstick.h:291
int getDiagonalRange()
Get the assigned diagonal range value.
Definition: joycontrolstick.cpp:198
virtual QString getPartialName(bool forceFullFormat=false, bool displayNames=false)
Definition: joycontrolstick.cpp:798
virtual void writeConfig(QXmlStreamWriter *xml)
Write the status of the properties of a stick and direction buttons to an XML stream.
Definition: joycontrolstick.cpp:1081
bool hasSameButtonsMouseCurve()
Definition: joycontrolstick.cpp:1985
@ StickRightUp
Definition: joycontrolstickdirectionstype.h:32
double getButtonsAccelerationEasingDuration()
Definition: joycontrolstick.cpp:3073
@ FourWayDiagonal
Definition: joycontrolstick.h:50
void stickDirectionChangeEvent()
Slot called when directionDelayTimer has timed out. The method will call createDeskEvent.
Definition: joycontrolstick.cpp:2769
void setButtonsSpringWidth(int value)
Definition: joycontrolstick.cpp:2040
double getCircleAdjust()
Get the current percentage of the outer square that should be ignored when performing the final axis ...
Definition: joycontrolstick.cpp:2763
static const int DEFAULTMODIFIERZONE
Definition: globalvariables.h:219
void performButtonRelease(JoyControlStickButton *&eventbutton, bool ignoresets)
Stick direction button to release.
Definition: joycontrolstick.cpp:2248
QList< int > getFourWayDiagonalZoneAngles()
Definition: joycontrolstick.cpp:1801
void setCircleAdjust(double circle)
Set the percentage of the outer square that should be ignored when performing the final axis calculat...
Definition: joycontrolstick.cpp:2748
static const int DEFAULTSTICKDELAY
Definition: globalvariables.h:223
void setButtonsEasingDuration(double value)
Definition: joycontrolstick.cpp:2783
double getDistanceFromDeadZone()
Get current radial distance of the stick position past the assigned dead zone.
Definition: joycontrolstick.cpp:389
double circle
Definition: joycontrolstick.h:287
double getButtonsStartAccelerationMultiplier()
Definition: joycontrolstick.cpp:2941
QPointer< JoyAxis > axisY
Definition: joycontrolstick.h:294
@ StickDown
Definition: joycontrolstickdirectionstype.h:30
static const int DEFAULTDIAGONALRANGE
Definition: globalvariables.h:221
JoyStickDirections
Definition: joycontrolstickdirectionstype.h:25
int maxZone
Definition: joycontrolstick.h:283
void removeControlStick(bool performRelease=true)
Definition: joyaxis.cpp:526
int getRealJoyIndex()
Definition: joycontrolstick.cpp:745
int index
Definition: joycontrolstick.h:284
~JoyControlStick()
Definition: joycontrolstick.cpp:59
void setButtonsWheelSpeedX(int value)
Definition: joycontrolstick.cpp:2192
void reset()
Definition: joycontrolstick.cpp:847
JoyStickDirections getCurrentDirection()
Get the value for the currently active stick direction.
Definition: joycontrolstick.cpp:1668
void setModifierZone(int value)
Sets the modifier zone of the stick to the given value.
Definition: joycontrolstick.cpp:898
JoyControlStickButton * getDirectionButton(JoyStickDirections direction)
Get a pointer to the stick direction button for the desired direction.
Definition: joycontrolstick.cpp:1179
void releaseButtonEvents()
Definition: joycontrolstick.cpp:1870
bool isCalibrated() const
Check if the stick is calibrated.
Definition: joycontrolstick.cpp:928
SetJoystick * getParentSet()
Definition: joyaxis.cpp:777
void setButtonsWheelSpeedY(int value)
Definition: joycontrolstick.cpp:2203
void setButtonsExtraAccelerationMultiplier(double value)
Definition: joycontrolstick.cpp:2885
@ StickRight
Definition: joycontrolstickdirectionstype.h:29
void setCalibration(double offsetX, double gainX, double offsetY, double gainY)
Sets the axis calibration values and sets the calibration flag. Calibrated value is calculated by the...
Definition: joycontrolstick.cpp:960
bool getModifierZoneInverted() const
Checks if the modifier zone of this stick is inverted.
Definition: joycontrolstick.cpp:843
double calculateYDiagonalDeadZone(int axisXValue, int axisYValue)
Definition: joycontrolstick.cpp:3707
@ StickLeftUp
Definition: joycontrolstickdirectionstype.h:34
void setButtonsSpringHeight(int value)
Definition: joycontrolstick.cpp:2051
JoyControlStickButton * activeButton2
Definition: joycontrolstick.h:297
@ EightWayMode
Definition: joycontrolstick.h:48
void replaceAxes(JoyAxis *axisX, JoyAxis *axisY)
Definition: joycontrolstick.cpp:1846
void maxZoneChanged(int value)
double getSpringDeadCircleX()
Definition: joycontrolstick.cpp:3754
void setModifierZoneInverted(bool value)
Inverts the direction of the modifier zone of the stick.
Definition: joycontrolstick.cpp:914
QString defaultStickName
Definition: joycontrolstick.h:304
void setDeadZone(int value)
Definition: joycontrolstick.cpp:870
int calculateCircleXValue(int axisXValue, int axisYValue)
Definition: joycontrolstick.cpp:1704
@ StickLeft
Definition: joycontrolstickdirectionstype.h:31
static const int AXISMAX
Definition: globalvariables.h:118
virtual void readConfig(QXmlStreamReader *xml)
Take a XML stream and set the stick and direction button properties according to the values contained...
Definition: joycontrolstick.cpp:990
@ StickLeftDown
Definition: joycontrolstickdirectionstype.h:35
void determineFourWayDiagonalEvent(JoyControlStickButton *&eventbutton3)
Determine which stick direction button should be active when using 4 way diagonal mode.
Definition: joycontrolstick.cpp:2413
double getButtonsEasingDuration()
Definition: joycontrolstick.cpp:2794
JoyMode getJoyMode()
Definition: joycontrolstick.cpp:1868
Represents stick of a joystick.
Definition: joycontrolstick.h:37
void disconnectPropertyUpdatedConnection()
Definition: joycontrolstick.cpp:2629
QString stickName
Definition: joycontrolstick.h:303
int getCircleYCoordinate()
Definition: joycontrolstick.cpp:1693
int getButtonsSpringDeadCircleMultiplier()
Definition: joycontrolstick.cpp:3116
double calculateLastAccelerationDirectionalDistance()
Definition: joycontrolstick.cpp:1552
void setControlStick(JoyControlStick *stick)
Definition: joyaxis.cpp:514
JoyControlStick(JoyAxis *axisX, JoyAxis *axisY, int index, int originset, QObject *parent)
Definition: joycontrolstick.cpp:40
void setMaxZone(int value)
Definition: joycontrolstick.cpp:882
Definition: joycontrolstickdirectionstype.h:22
void determineStandardModeEvent(JoyControlStickButton *&eventbutton1, JoyControlStickButton *&eventbutton2)
Determine which stick direction buttons should be active for a standard mode stick.
Definition: joycontrolstick.cpp:2260
bool hasPendingEvent()
Definition: joycontrolstick.cpp:2830
double calculateLastMouseDirectionalDistance(JoyControlStickButton *button)
Definition: joycontrolstick.cpp:1280
static const bool DEFAULTMODIFIERZONEINVERTED
Definition: globalvariables.h:220
bool hasSlotsAssigned()
Check all stick buttons and see if any have slots assigned.
Definition: joycontrolstick.cpp:2638
void setButtonsSpringRelativeStatus(bool value)
Definition: joycontrolstick.cpp:2660
int getModifierZone() const
Returns the modifier zone of the stick.
Definition: joycontrolstick.cpp:837
int getStickDelay()
Definition: joycontrolstick.cpp:2781
double getSpringDeadCircleY()
Definition: joycontrolstick.cpp:3796
double calculateBearing()
Calculate the bearing (in degrees) corresponding to the current position of the X and Y axes of a sti...
Definition: joycontrolstick.cpp:335
double getRadialDistance(int axisXValue, int axisYValue)
Definition: joycontrolstick.cpp:724
void circleAdjustChange(double circle)
int getIndex()
Definition: joycontrolstick.cpp:743
void copyAssignments(JoyControlStick *destStick)
Copy slots from all stick buttons and properties from a stick onto another.
Definition: joycontrolstick.cpp:2704
void createDeskEvent(bool ignoresets=false)
Find the position of the two stick axes, deactivate no longer used stick direction button and then ac...
Definition: joycontrolstick.cpp:207
QHash< JoyStickDirections, JoyControlStickButton * > getApplicableButtons()
Definition: joycontrolstick.cpp:2157
JoyControlStick::JoyStickDirections determineFourWayCardinalDirection()
Find the current stick direction based on a Four Way Cardinal mode stick.
Definition: joycontrolstick.cpp:2516
JoyMode
Definition: joycontrolstick.h:45
double getButtonsMinAccelerationThreshold()
Definition: joycontrolstick.cpp:2985
void establishPropertyUpdatedConnection()
Definition: joycontrolstick.cpp:2624
static const int DEFAULTMAXZONE
Definition: globalvariables.h:218
double calculateMouseDirectionalDistance(JoyControlStickButton *button)
Used to calculate the distance value that should be used for mouse movement.
Definition: joycontrolstick.cpp:1192
@ StickCentered
Definition: joycontrolstickdirectionstype.h:27
double calculateXAxisDistance(int axisXValue)
Definition: joycontrolstick.cpp:3595
void stickDelayChanged(int value)
bool getButtonsExtraAccelerationStatus()
Definition: joycontrolstick.cpp:2858
void clearPendingEvent()
Definition: joycontrolstick.cpp:2843
virtual void setDefaultStickName(QString tempname)
Definition: joycontrolstick.cpp:824
void deadZoneChanged(int value)
bool m_modifier_zone_inverted
Definition: joycontrolstick.h:281
void setButtonsSpringDeadCircleMultiplier(int value)
Definition: joycontrolstick.cpp:3103
@ FourWayCardinal
Definition: joycontrolstick.h:49
@ StandardMode
Definition: joycontrolstick.h:47
void queueJoyEvent(bool ignoresets)
Definition: joycontrolstick.cpp:2823
void resetCalibration()
Resets the calibration of both stick axes back to uncalibrated state.
Definition: joycontrolstick.cpp:933
void replaceXAxis(JoyAxis *axis)
Definition: joycontrolstick.cpp:1826
void setStickName(QString tempName)
Definition: joycontrolstick.cpp:2180
it is up to the author donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License If the distribution and or use of the Library is restricted in certain countries either by patents or by copyrighted the original copyright holder who places the Library under this License may add an geographical distribution limitation excluding those so that distribution is permitted only in or among countries not thus excluded In such this License incorporates the limitation as if written in the body of this License The Free Software Foundation may publish revised and or new versions of the Lesser General Public License from time to time Such new versions will be similar in spirit to the present but may differ in detail to address new problems or concerns Each version is given a distinguishing version number If the Library specifies a version number of this License which applies to it and any later you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation If the Library does not specify a license version number
Definition: lgpl-2.1.txt:423
JoyMode currentMode
Definition: joycontrolstick.h:301
int getCircleXCoordinate()
Definition: joycontrolstick.cpp:1682
QList< int > getFourWayCardinalZoneAngles()
Definition: joycontrolstick.cpp:1782
void setButtonsMouseCurve(JoyButton::JoyMouseCurve mouseCurve)
Definition: joycontrolstick.cpp:1974
bool isRelativeSpring()
Definition: joycontrolstick.cpp:2671
JoyStickDirections currentDirection
Definition: joycontrolstick.h:300
double calculateEightWayDiagonalDistance(int axisXValue, int axisYValue)
Definition: joycontrolstick.cpp:3644
int originset
Definition: joycontrolstick.h:278
void replaceYAxis(JoyAxis *axis)
Definition: joycontrolstick.cpp:1836
JoyControlStickButton * activeButton1
Definition: joycontrolstick.h:296
QTimer directionDelayTimer
Definition: joycontrolstick.h:306
int getYCoordinate()
Get the value for the corresponding Y axis.
Definition: joycontrolstick.cpp:1680
bool safezone
Definition: joycontrolstick.h:290
@ StickRightDown
Definition: joycontrolstickdirectionstype.h:33
int getButtonsPresetSpringHeight()
Definition: joycontrolstick.cpp:2090
JoyControlStickModifierButton * getModifierButton()
Definition: joycontrolstick.cpp:2821
void setJoyMode(JoyMode mode)
Definition: joycontrolstick.cpp:1861
double getButtonsMaxAccelerationThreshold()
Definition: joycontrolstick.cpp:3029
void setIndex(int index)
Definition: joycontrolstick.cpp:741
static const double DEFAULTCIRCLE
Definition: globalvariables.h:222
void determineEightWayModeEvent(JoyControlStickButton *&eventbutton1, JoyControlStickButton *&eventbutton2, JoyControlStickButton *&eventbutton3)
Determine which stick direction button should be active for a 8 way mode stick.
Definition: joycontrolstick.cpp:2321
double calculateYAxisDistance(int axisYValue)
Definition: joycontrolstick.cpp:3610
static const JoyMode DEFAULTMODE
Definition: joycontrolstick.h:189