AntiMicroX
setjoystick.h
Go to the documentation of this file.
1 /* antimicrox Gamepad to KB+M event mapper
2  * Copyright (C) 2015 Travis Nickles <nickles.travis@gmail.com>
3  * Copyright (C) 2020 Jagoda Górska <juliagoda.pl@protonmail>
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9 
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14 
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef SETJOYSTICK_H
20 #define SETJOYSTICK_H
21 
22 #include "joyaxis.h"
23 #include "joysensordirection.h"
24 #include "joysensortype.h"
25 #include "xml/setjoystickxml.h"
26 
27 class InputDevice;
28 class JoyButton;
29 class JoyDPad;
30 class JoyControlStick;
31 class JoySensor;
32 class VDPad;
33 
40 {
41  Q_OBJECT
42 
43  public:
44  explicit SetJoystick(InputDevice *device, int index, QObject *parent);
45  explicit SetJoystick(InputDevice *device, int index, bool runreset, QObject *parent);
46  ~SetJoystick();
47 
48  JoyAxis *getJoyAxis(int index) const;
49  JoyButton *getJoyButton(int index) const;
50  JoyDPad *getJoyDPad(int index) const;
51  JoyControlStick *getJoyStick(int index) const;
52  JoySensor *getSensor(JoySensorType type) const;
53  VDPad *getVDPad(int index) const;
54 
55  int getNumberButtons() const;
56  int getNumberAxes() const;
57  int getNumberHats() const;
58  int getNumberSticks() const;
59  bool hasSensor(JoySensorType type) const;
60  int getNumberVDPads() const;
61 
62  QHash<int, JoyButton *> const &getButtons() const;
63  QHash<int, JoyDPad *> const &getHats() const;
64  QHash<int, JoyControlStick *> const &getSticks() const;
65  QHash<JoySensorType, JoySensor *> const &getSensors() const;
66  QHash<int, VDPad *> const &getVdpads() const;
67  QHash<int, JoyAxis *> *getAxes();
68 
69  int getIndex() const;
70  int getRealIndex() const;
71  virtual void refreshButtons(); // SetButton class
72  virtual void refreshAxes(); // SetAxis class
73  virtual void refreshHats(); // SetHat class
74  virtual void refreshSensors();
75  void release();
76  void addControlStick(int index, JoyControlStick *stick); // SetStick class
77  void removeControlStick(int index); // SetStick class
78  void addVDPad(int index, VDPad *vdpad); // SetVDPad class
79  void removeVDPad(int index); // SetVDPad class
80  void setIgnoreEventState(bool ignore);
81 
82  InputDevice *getInputDevice() const;
83 
84  void setName(QString name);
85  QString getName() const;
86  QString getSetLabel();
87 
88  void raiseAxesDeadZones(int deadZone = 0); // SetAxis class
89  void currentAxesDeadZones(QList<int> *axesDeadZones); // SetAxis class
90  void setAxesDeadZones(QList<int> *axesDeadZones); // SetAxis class
91  void setAxisThrottle(int axisNum, JoyAxis::ThrottleTypes throttle); // SetAxis class
92  QList<JoyButton *> const &getLastClickedButtons() const;
93  void removeAllBtnFromQueue();
94  int getCountBtnInList(QString partialName);
95  bool isSetEmpty();
96 
97  protected:
98  void deleteButtons(); // SetButton class
99  void deleteAxes(); // SetAxis class
100  void deleteHats(); // SetHat class
101  void deleteSticks(); // SetStick class
102  void deleteSensors();
103  void deleteVDpads(); // SetVDPad class
104 
105  void enableButtonConnections(JoyButton *button); // SetButton class
106  void enableAxisConnections(JoyAxis *axis); // SetAxis class
107  void enableHatConnections(JoyDPad *dpad); // SetHat class
108  void enableSensorConnections(JoySensor *sensor);
109 
110  signals:
111  void setChangeActivated(int index);
112  void setAssignmentButtonChanged(int button, int originset, int newset, int mode); // SetButton class
113  void setAssignmentAxisChanged(int button, int axis, int originset, int newset, int mode); // SetAxis class
114  void setAssignmentStickChanged(int button, int stick, int originset, int newset, int mode); // SetStick class
115  void setAssignmentSensorChanged(JoySensorDirection direction, JoySensorType sensor, int originset, int newset, int mode);
116  void setAssignmentDPadChanged(int button, int dpad, int originset, int newset, int mode); // SetHat class
117  void setAssignmentVDPadChanged(int button, int dpad, int originset, int newset, int mode); // SetVDPad class
118  void setAssignmentAxisThrottleChanged(int axis, int originset); // SetAxis class
119  void setButtonClick(int index, int button); // SetButton class
120  void setButtonRelease(int index, int button); // SetButton class
121  void setAxisButtonClick(int setindex, int axis, int button); // SetAxis class
122  void setAxisButtonRelease(int setindex, int axis, int button); // SetAxis class
123  void setAxisActivated(int setindex, int axis, int value); // SetAxis class
124  void setAxisReleased(int setindex, int axis, int value); // SetAxis class
125  void setStickButtonClick(int setindex, int stick, int button); // SetStick class
126  void setStickButtonRelease(int setindex, int stick, int button); // SetStick class
127  void setSensorActivated(int setindex, JoySensorType type, int value);
128  void setSensorReleased(int setindex, JoySensorType, int value);
129  void setSensorButtonClick(int setindex, JoySensorType type, JoySensorDirection direction);
130  void setSensorButtonRelease(int setindex, JoySensorType type, JoySensorDirection direction);
131  void setDPadButtonClick(int setindex, int dpad, int button); // SetHat class
132  void setDPadButtonRelease(int setindex, int dpad, int button); // SetHat class
133 
134  void setButtonNameChange(int index); // SetButton class
135  void setAxisButtonNameChange(int axisIndex, int buttonIndex); // SetAxis class
136  void setStickButtonNameChange(int stickIndex, int buttonIndex); // SetStick class
138  void setDPadButtonNameChange(int dpadIndex, int buttonIndex); // SetHat class
139  void setVDPadButtonNameChange(int vdpadIndex, int buttonIndex); // SetVDPad class
140 
141  void setAxisNameChange(int axisIndex); // SetAxis class
142  void setStickNameChange(int stickIndex); // SetStick class
144  void setDPadNameChange(int dpadIndex); // SetHat class
145  void setVDPadNameChange(int vdpadIndex); // SetVDPad class
146  void propertyUpdated();
147 
148  public slots:
149  virtual void reset();
150  void copyAssignments(SetJoystick *destSet);
151  void propogateSetChange(int index);
152  void propogateSetButtonAssociation(int button, int newset, int mode); // SetButton class
153  void propogateSetAxisButtonAssociation(int button, int axis, int newset, int mode); // SetAxis class
154  void propogateSetStickButtonAssociation(int button, int stick, int newset, int mode); // SetStick class
155  void propagateSetSensorButtonAssociation(JoySensorDirection direction, JoySensorType sensor, int newset, int mode);
156  void propogateSetDPadButtonAssociation(int button, int dpad, int newset, int mode); // SetHat class
157  void propogateSetVDPadButtonAssociation(int button, int dpad, int newset, int mode); // SetVDPad class
160 
161  protected slots:
162  void propogateSetAxisThrottleSetting(int index); // SetAxis class
163  void propogateSetButtonClick(int button); // SetButton class
164  void propogateSetButtonRelease(int button); // SetButton class
165  void propogateSetAxisButtonClick(int button); // SetAxis class
166  void propogateSetAxisButtonRelease(int button); // SetAxis class
167  void propogateSetStickButtonClick(int button); // SetStick class
168  void propogateSetStickButtonRelease(int button); // SetStick class
169  void propagateSetSensorButtonClick(int button);
170  void propagateSetSensorButtonRelease(int button);
171  void propogateSetDPadButtonClick(int button); // SetHat class
172  void propogateSetDPadButtonRelease(int button); // SetHat class
173  void propogateSetAxisActivated(int value); // SetAxis class
174  void propogateSetAxisReleased(int value); // SetAxis class
175 
176  void propogateSetButtonNameChange(); // SetButton class
177  void propogateSetAxisButtonNameChange(); // SetAxis class
178  void propogateSetStickButtonNameChange(); // SetStick class
180  void propogateSetDPadButtonNameChange(); // SetHat class
181  void propogateSetVDPadButtonNameChange(); // SetVDPad class
182 
183  void propogateSetAxisNameChange(); // SetAxis class
184  void propogateSetStickNameChange(); // SetStick class
186  void propogateSetDPadNameChange(); // SetHat class
187  void propogateSetVDPadNameChange(); // SetVDPad class
188 
189  private:
190  QHash<int, JoyButton *> m_buttons;
191  QHash<int, JoyAxis *> axes;
192  QHash<int, JoyDPad *> hats;
193  QHash<int, JoyControlStick *> sticks;
194  QHash<JoySensorType, JoySensor *> m_sensors;
195  QHash<int, VDPad *> vdpads;
196 
197  QList<JoyButton *> lastClickedButtons;
198 
199  int m_index;
201  QString m_name;
202 };
203 
204 Q_DECLARE_METATYPE(SetJoystick *)
205 
206 #endif // SETJOYSTICK_H
JoyControlStick::getButtons
QHash< JoyStickDirections, JoyControlStickButton * > * getButtons()
Definition: joycontrolstick.cpp:1820
JoyAxis::eventReset
virtual void eventReset()
Definition: joyaxis.cpp:911
SetJoystick::enableButtonConnections
void enableButtonConnections(JoyButton *button)
Definition: setjoystick.cpp:856
SetJoystick::addControlStick
void addControlStick(int index, JoyControlStick *stick)
Definition: setjoystick.cpp:436
JoyDPad::getJoyButtons
QHash< int, JoyDPadButton * > * getJoyButtons()
Definition: joydpad.cpp:200
JoyAxis::throttleChangePropogated
void throttleChangePropogated(int index)
InputDevice::buttonClickEvent
virtual void buttonClickEvent(int buttonindex)
Definition: inputdevice.cpp:722
SetJoystick::propogateSetStickButtonAssociation
void propogateSetStickButtonAssociation(int button, int stick, int newset, int mode)
Definition: setjoystick.cpp:287
joycontrolstickbutton.h
SetJoystick::propogateSetAxisThrottleSetting
void propogateSetAxisThrottleSetting(int index)
Definition: setjoystick.cpp:428
SetJoystick::propogateSetDPadButtonClick
void propogateSetDPadButtonClick(int button)
Definition: setjoystick.cpp:635
JoyAxis::released
void released(int value)
SetJoystick::refreshButtons
virtual void refreshButtons()
Definition: setjoystick.cpp:73
SetJoystick::propogateSetAxisButtonAssociation
void propogateSetAxisButtonAssociation(int button, int axis, int newset, int mode)
Definition: setjoystick.cpp:281
SetJoystick::setAxisActivated
void setAxisActivated(int setindex, int axis, int value)
SetJoystick::getIndex
int getIndex() const
Definition: setjoystick.cpp:507
SetJoystick::refreshAxes
virtual void refreshAxes()
Definition: setjoystick.cpp:85
JoyAxis::setDeadZone
void setDeadZone(int value)
Definition: joyaxis.cpp:354
JoyButton::eventReset
virtual void eventReset()
Definition: joybutton.cpp:3082
SetJoystick::refreshSensors
virtual void refreshSensors()
Setup sensor objects for all available hardware sensors.
Definition: setjoystick.cpp:120
joycontrolstick.h
SetJoystick::getSensor
JoySensor * getSensor(JoySensorType type) const
Definition: setjoystick.cpp:71
SetJoystick::setSensorReleased
void setSensorReleased(int setindex, JoySensorType, int value)
JoyAxis::getIndex
int getIndex()
Definition: joyaxis.cpp:317
SetJoystick::~SetJoystick
~SetJoystick()
Definition: setjoystick.cpp:55
JoyAxis
Represents single axis of of joystick (or other input)
Definition: joyaxis.h:40
SetJoystick::setAssignmentSensorChanged
void setAssignmentSensorChanged(JoySensorDirection direction, JoySensorType sensor, int originset, int newset, int mode)
JoyButton::setChangeActivated
void setChangeActivated(int index)
SetJoystick::getSensors
const QHash< JoySensorType, JoySensor * > & getSensors() const
Get all sensor objects in this set.
Definition: setjoystick.cpp:1113
JoyAxis::copyAssignments
void copyAssignments(JoyAxis *destAxis)
Definition: joyaxis.cpp:820
JoyButton::getPartialName
virtual QString getPartialName(bool forceFullFormat=false, bool displayNames=false) const
Definition: joybutton.cpp:1601
SetJoystick::getName
QString getName() const
Definition: setjoystick.cpp:948
SetJoystick::m_buttons
QHash< int, JoyButton * > m_buttons
Definition: setjoystick.h:190
JoyDPad::getIndex
int getIndex()
Definition: joydpad.cpp:109
SetJoystick::setIgnoreEventState
void setIgnoreEventState(bool ignore)
Definition: setjoystick.cpp:756
SetJoystick::setAxisNameChange
void setAxisNameChange(int axisIndex)
SetJoystick::setVDPadButtonNameChange
void setVDPadButtonNameChange(int vdpadIndex, int buttonIndex)
globalvariables.h
InputDevice::getNumberAxes
virtual int getNumberAxes()
Definition: inputdevice.cpp:567
SetJoystick::propagateSetSensorButtonClick
void propagateSetSensorButtonClick(int button)
Definition: setjoystick.cpp:609
SetJoystick::getHats
const QHash< int, JoyDPad * > & getHats() const
Definition: setjoystick.cpp:1105
SetJoystick::lastClickedButtons
QList< JoyButton * > lastClickedButtons
Definition: setjoystick.h:197
JoyAxis::active
void active(int value)
InputDevice::hasCalibrationThrottle
bool hasCalibrationThrottle(int axisNum)
Definition: inputdevice.cpp:1343
SetJoystick::propogateSetStickButtonClick
void propogateSetStickButtonClick(int button)
Definition: setjoystick.cpp:583
joysensor.h
SetJoystick::m_name
QString m_name
Definition: setjoystick.h:201
SetJoystick::setStickNameChange
void setStickNameChange(int stickIndex)
SetJoystick::propogateSetStickNameChange
void propogateSetStickNameChange()
Definition: setjoystick.cpp:724
SetJoystick::refreshHats
virtual void refreshHats()
Definition: setjoystick.cpp:105
SetJoystick::setAxisButtonRelease
void setAxisButtonRelease(int setindex, int axis, int button)
JoyDPad::dpadNameChanged
void dpadNameChanged()
SetJoystick::setButtonRelease
void setButtonRelease(int index, int button)
InputDevice
Abstract class representing a hardware input device, e.g a joystick or controller.
Definition: inputdevice.h:50
SetJoystick::getVDPad
VDPad * getVDPad(int index) const
Definition: setjoystick.cpp:67
SetJoystick::setDPadNameChange
void setDPadNameChange(int dpadIndex)
SetJoystick::propogateSetAxisButtonClick
void propogateSetAxisButtonClick(int button)
Definition: setjoystick.cpp:557
SetJoystick::getNumberAxes
int getNumberAxes() const
Definition: setjoystick.cpp:243
SetJoystick::setSensorButtonClick
void setSensorButtonClick(int setindex, JoySensorType type, JoySensorDirection direction)
SetJoystick::setAxisButtonClick
void setAxisButtonClick(int setindex, int axis, int button)
JoyAxis::getDeadZone
int getDeadZone()
Definition: joyaxis.cpp:365
SetJoystick::setSensorActivated
void setSensorActivated(int setindex, JoySensorType type, int value)
SetJoystick
A set of mapped events which can by switched by a controller event. Contains controller input objects...
Definition: setjoystick.h:39
SetJoystick::setAssignmentStickChanged
void setAssignmentStickChanged(int button, int stick, int originset, int newset, int mode)
SetJoystick::deleteAxes
void deleteAxes()
Definition: setjoystick.cpp:155
JoyDPad::eventReset
virtual void eventReset()
Definition: joydpad.cpp:1083
SetJoystick::reset
virtual void reset()
Re-enumerates inputs from the associated device and resets all mappings in this set.
Definition: setjoystick.cpp:261
JoyDPadButton::getDPad
JoyDPad * getDPad() const
Definition: joydpadbutton.cpp:154
JoyControlStick::isDefault
virtual bool isDefault()
Definition: joycontrolstick.cpp:1881
SetJoystick::propogateSetDPadButtonAssociation
void propogateSetDPadButtonAssociation(int button, int dpad, int newset, int mode)
Definition: setjoystick.cpp:303
JoyDPad::getButtons
QHash< int, JoyDPadButton * > * getButtons()
Definition: joydpad.cpp:223
SetJoystick::getNumberVDPads
int getNumberVDPads() const
Definition: setjoystick.cpp:255
SetJoystick::setAxisThrottle
void setAxisThrottle(int axisNum, JoyAxis::ThrottleTypes throttle)
Definition: setjoystick.cpp:1092
InputDevice::getNumberRawAxes
virtual int getNumberRawAxes()=0
SetJoystick::raiseAxesDeadZones
void raiseAxesDeadZones(int deadZone=0)
Raise the dead zones for axes. Used when launching the controller mapping window.
Definition: setjoystick.cpp:1042
SetJoystick::setSensorNameChange
void setSensorNameChange(JoySensorType type)
SetJoystick::deleteSticks
void deleteSticks()
Definition: setjoystick.cpp:173
SetJoystick::copyAssignments
void copyAssignments(SetJoystick *destSet)
Definition: setjoystick.cpp:950
SetJoystick::setSensorButtonNameChange
void setSensorButtonNameChange(JoySensorType type, JoySensorDirection direction)
JoyAxis::getCurrentlyAssignedSet
int getCurrentlyAssignedSet()
Definition: joyaxis.cpp:512
JoyButton::copyAssignments
void copyAssignments(JoyButton *destButton)
Copy assignments and properties from one button to another. Used for set copying.
Definition: joybutton.cpp:4083
SetJoystick::propogateSetChange
void propogateSetChange(int index)
Definition: setjoystick.cpp:273
SetJoystick::setStickButtonClick
void setStickButtonClick(int setindex, int stick, int button)
SetJoystick::setAssignmentVDPadChanged
void setAssignmentVDPadChanged(int button, int dpad, int originset, int newset, int mode)
SetJoystick::deleteHats
void deleteHats()
Definition: setjoystick.cpp:209
SetJoystick::setSensorButtonRelease
void setSensorButtonRelease(int setindex, JoySensorType type, JoySensorDirection direction)
SetJoystick::setChangeActivated
void setChangeActivated(int index)
SetJoystick::setStickButtonRelease
void setStickButtonRelease(int setindex, int stick, int button)
SetJoystick::getJoyStick
JoyControlStick * getJoyStick(int index) const
Definition: setjoystick.cpp:69
JoyAxis::getPAxisButton
JoyAxisButton * getPAxisButton()
Definition: joyaxis.cpp:459
SetJoystick::enableAxisConnections
void enableAxisConnections(JoyAxis *axis)
Definition: setjoystick.cpp:867
SetJoystick::hasSensor
bool hasSensor(JoySensorType type) const
Checks if this set has a sensor.
Definition: setjoystick.cpp:253
JoySensorType
JoySensorType
Definition: joysensortype.h:23
SetJoystick::propogateSetButtonAssociation
void propogateSetButtonAssociation(int button, int newset, int mode)
Definition: setjoystick.cpp:275
SetJoystick::setAxesDeadZones
void setAxesDeadZones(QList< int > *axesDeadZones)
Definition: setjoystick.cpp:1071
vdpad.h
JoyButton::joyEvent
void joyEvent(bool pressed, bool ignoresets=false)
Activates mapped slots and generates QT events which highlight pressed controller buttons.
Definition: joybutton.cpp:176
JoyButton::getButtonState
bool getButtonState()
Checks if this button is currently active.
Definition: joybutton.cpp:2471
SetJoystick::propogateSetDPadButtonRelease
void propogateSetDPadButtonRelease(int button)
Definition: setjoystick.cpp:650
SetJoystick::propogateSetButtonRelease
void propogateSetButtonRelease(int button)
Definition: setjoystick.cpp:546
InputDevice::buttonReleaseEvent
virtual void buttonReleaseEvent(int buttonindex)
Definition: inputdevice.cpp:724
SetJoystick::setDPadButtonRelease
void setDPadButtonRelease(int setindex, int dpad, int button)
SetJoystick::getVdpads
const QHash< int, VDPad * > & getVdpads() const
Definition: setjoystick.cpp:1115
JoyDPad::isDefault
virtual bool isDefault()
Definition: joydpad.cpp:225
GlobalVariables::SetJoystick::RAISEDDEADZONE
static const int RAISEDDEADZONE
Definition: globalvariables.h:195
JoyAxis::axisNameChanged
void axisNameChanged()
JoyAxis::joyEvent
void joyEvent(int value, bool ignoresets=false, bool updateLastValues=true)
Definition: joyaxis.cpp:130
InputDevice::getCalibrationThrottle
JoyAxis::ThrottleTypes getCalibrationThrottle(int axisNum)
Definition: inputdevice.cpp:1353
JoyDPad::copyAssignments
void copyAssignments(JoyDPad *destDPad)
Definition: joydpad.cpp:616
SetJoystick::axes
QHash< int, JoyAxis * > axes
Definition: setjoystick.h:191
JoyControlStickButton
Definition: joycontrolstickbutton.h:28
SetJoystick::propogateSetStickButtonRelease
void propogateSetStickButtonRelease(int button)
Definition: setjoystick.cpp:596
JoyDPadButton::setAssignmentChanged
void setAssignmentChanged(int current_button, int dpad_index, int associated_set, int mode)
SetJoystick::hats
QHash< int, JoyDPad * > hats
Definition: setjoystick.h:192
VDPad
Definition: vdpad.h:26
JoyButton::released
void released(int index)
SetJoystick::m_device
InputDevice * m_device
Definition: setjoystick.h:200
SetJoystick::propertyUpdated
void propertyUpdated()
SetJoystick::getLastClickedButtons
const QList< JoyButton * > & getLastClickedButtons() const
Definition: setjoystick.cpp:525
SetJoystick::setDPadButtonClick
void setDPadButtonClick(int setindex, int dpad, int button)
setjoystickxml.h
SetJoystick::getNumberSticks
int getNumberSticks() const
Definition: setjoystick.cpp:247
JoyButton::clicked
void clicked(int index)
SetJoystick::setAssignmentDPadChanged
void setAssignmentDPadChanged(int button, int dpad, int originset, int newset, int mode)
SetJoystick::propogateSetButtonNameChange
void propogateSetButtonNameChange()
Definition: setjoystick.cpp:665
SetJoystick::currentAxesDeadZones
void currentAxesDeadZones(QList< int > *axesDeadZones)
Definition: setjoystick.cpp:1060
SetJoystick::propogateSetAxisNameChange
void propogateSetAxisNameChange()
Definition: setjoystick.cpp:716
JoyControlStickButton::setAssignmentChanged
void setAssignmentChanged(int current_button, int axis_index, int associated_set, int mode)
SetJoystick::propogateSetButtonClick
void propogateSetButtonClick(int button)
Definition: setjoystick.cpp:511
GlobalVariables::SetJoystick::MAXNAMELENGTH
static const int MAXNAMELENGTH
Definition: globalvariables.h:194
JoyDPad::joyEvent
void joyEvent(int value, bool ignoresets=false)
Definition: joydpad.cpp:143
SetJoystick::getRealIndex
int getRealIndex() const
Definition: setjoystick.cpp:509
JoySensorButton::setAssignmentChanged
void setAssignmentChanged(JoySensorDirection direction, JoySensorType type, int associated_set, int mode)
InputDevice::dpadButtonReleaseEvent
virtual void dpadButtonReleaseEvent(int buttonindex)
Definition: inputdevice.cpp:748
InputDevice::getNumberRawButtons
virtual int getNumberRawButtons()=0
InputDevice::hasRawSensor
virtual bool hasRawSensor(JoySensorType type)=0
SetJoystick::setButtonClick
void setButtonClick(int index, int button)
SetJoystick::setAxisButtonNameChange
void setAxisButtonNameChange(int axisIndex, int buttonIndex)
JoyDPad
Definition: joydpad.h:24
JoySensorButton
Represents a sensor mapping in a SetJoystick.
Definition: joysensorbutton.h:30
JoyAxis::isDefault
virtual bool isDefault()
Definition: joyaxis.cpp:565
JoySensorButton::getSensor
JoySensor * getSensor() const
Get the JoySensor associated to this button.
Definition: joysensorbutton.cpp:152
SetJoystick::propogateSetDPadNameChange
void propogateSetDPadNameChange()
Definition: setjoystick.cpp:740
SetJoystick::getJoyButton
JoyButton * getJoyButton(int index) const
Definition: setjoystick.cpp:57
JoyAxis::clearPendingEvent
void clearPendingEvent()
Definition: joyaxis.cpp:89
inputdevice.h
SetJoystick::setAssignmentButtonChanged
void setAssignmentButtonChanged(int button, int originset, int newset, int mode)
SetJoystick::propogateSetStickButtonNameChange
void propogateSetStickButtonNameChange()
Definition: setjoystick.cpp:681
SetJoystick::getCountBtnInList
int getCountBtnInList(QString partialName)
Definition: setjoystick.cpp:533
JoySensor::sensorNameChanged
void sensorNameChanged()
joybutton.h
JoyDPadButton
Definition: joydpadbutton.h:27
SetJoystick::propogateSetAxisButtonRelease
void propogateSetAxisButtonRelease(int button)
Definition: setjoystick.cpp:570
JoySensorFactory::build
JoySensor * build(JoySensorType type, double rate, int originset, SetJoystick *parent_set, QObject *parent)
Definition: joysensorfactory.cpp:24
SetJoystick::propogateSetAxisActivated
void propogateSetAxisActivated(int value)
Definition: setjoystick.cpp:844
JoySensor::getType
JoySensorType getType() const
Returns the sensor type.
Definition: joysensor.cpp:247
SetJoystick::m_index
int m_index
Definition: setjoystick.h:199
SetJoystick::addVDPad
void addVDPad(int index, VDPad *vdpad)
Definition: setjoystick.cpp:473
JoyButton::getIgnoreEventState
bool getIgnoreEventState()
Definition: joybutton.cpp:3521
JoyControlStick
Represents stick of a joystick.
Definition: joycontrolstick.h:37
InputDevice::getNumberButtons
virtual int getNumberButtons()
Definition: inputdevice.cpp:565
JoyButton
Represents a single joystick button being part of a SetJoystick Contains multiple JoyButtonSlots whic...
Definition: joybutton.h:46
joysensortype.h
SetJoystick::release
void release()
Perform a release of all elements of a set. Stick and vdpad releases will be handled by the associate...
Definition: setjoystick.cpp:319
SetJoystick::setAxisReleased
void setAxisReleased(int setindex, int axis, int value)
SetJoystick::sticks
QHash< int, JoyControlStick * > sticks
Definition: setjoystick.h:193
SetJoystick::setAssignmentAxisChanged
void setAssignmentAxisChanged(int button, int axis, int originset, int newset, int mode)
JoyAxisButton
Definition: joyaxisbutton.h:29
SetJoystick::propogateSetAxisReleased
void propogateSetAxisReleased(int value)
Definition: setjoystick.cpp:850
SetJoystick::getJoyDPad
JoyDPad * getJoyDPad(int index) const
Definition: setjoystick.cpp:65
SetJoystick::deleteVDpads
void deleteVDpads()
Definition: setjoystick.cpp:191
SetJoystick::setVDPadNameChange
void setVDPadNameChange(int vdpadIndex)
SetJoystick::enableSensorConnections
void enableSensorConnections(JoySensor *sensor)
Establishes connections for event propagation between JoySensor and InputDevice.
Definition: setjoystick.cpp:913
JoyButton::isDefault
bool isDefault()
Check if button properties are at their default values.
Definition: joybutton.cpp:3475
JoyButton::getJoyNumber
int getJoyNumber()
Get 0 indexed number of SDL button index.
Definition: joybutton.cpp:358
SetJoystick::deleteButtons
void deleteButtons()
Definition: setjoystick.cpp:137
joyaxis.h
JoyControlStickButton::getStick
JoyControlStick * getStick() const
Definition: joycontrolstickbutton.cpp:271
SetJoystick::propagateSetSensorButtonNameChange
void propagateSetSensorButtonNameChange()
Propagate button rename event to InputDevice.
Definition: setjoystick.cpp:692
JoyButton::clearPendingEvent
void clearPendingEvent()
Definition: joybutton.cpp:152
SetJoystick::getInputDevice
InputDevice * getInputDevice() const
Definition: setjoystick.cpp:931
JoySensorDirection
JoySensorDirection
A bitfield style enum which encodes all possible three dimensional sensor directions....
Definition: joysensordirection.h:27
SetJoystick::getJoyAxis
JoyAxis * getJoyAxis(int index) const
Definition: setjoystick.cpp:59
JoyAxis::ThrottleTypes
ThrottleTypes
Definition: joyaxis.h:48
JoyAxis::getNAxisButton
JoyAxisButton * getNAxisButton()
Definition: joyaxis.cpp:461
JoyDPad::clearPendingEvent
void clearPendingEvent()
Definition: joydpad.cpp:136
SetJoystick::propogateSetVDPadButtonAssociation
void propogateSetVDPadButtonAssociation(int button, int dpad, int newset, int mode)
Definition: setjoystick.cpp:309
SetJoystick::propogateSetVDPadNameChange
void propogateSetVDPadNameChange()
Definition: setjoystick.cpp:748
JoySensor
Represents one sensor in a SetJoystick and its connections to other parts of the application....
Definition: joysensor.h:39
SetJoystick::setStickButtonNameChange
void setStickButtonNameChange(int stickIndex, int buttonIndex)
SetJoystick::getNumberButtons
int getNumberButtons() const
Definition: setjoystick.cpp:241
SetJoystick::getNumberHats
int getNumberHats() const
Definition: setjoystick.cpp:245
InputDevice::getNumberHats
virtual int getNumberHats()
Definition: inputdevice.cpp:569
setjoystick.h
SetJoystick::getButtons
const QHash< int, JoyButton * > & getButtons() const
Definition: setjoystick.cpp:1103
joysensorfactory.h
JoyControlStick::getIndex
int getIndex()
Definition: joycontrolstick.cpp:743
SetJoystick::setAssignmentAxisThrottleChanged
void setAssignmentAxisThrottleChanged(int axis, int originset)
JoyControlStick::copyAssignments
void copyAssignments(JoyControlStick *destStick)
Copy slots from all stick buttons and properties from a stick onto another.
Definition: joycontrolstick.cpp:2704
SetJoystick::propagateSetSensorNameChange
void propagateSetSensorNameChange()
Definition: setjoystick.cpp:732
JoyAxis::setInitialThrottle
void setInitialThrottle(int value)
Set the initial calibrated throttle based on the first event passed by SDL.
Definition: joyaxis.cpp:412
joysensorbutton.h
SetJoystick::setDPadButtonNameChange
void setDPadButtonNameChange(int dpadIndex, int buttonIndex)
joysensordirection.h
JoyAxisButton::getAxis
JoyAxis * getAxis() const
Definition: joyaxisbutton.cpp:183
InputDevice::profileEdited
void profileEdited()
Definition: inputdevice.cpp:1207
JoyButton::setAssignmentChanged
void setAssignmentChanged(int current_button, int associated_set, int mode)
SetJoystick::getAxes
QHash< int, JoyAxis * > * getAxes()
Definition: setjoystick.cpp:1101
SetJoystick::removeControlStick
void removeControlStick(int index)
Definition: setjoystick.cpp:462
SetJoystick::getSticks
const QHash< int, JoyControlStick * > & getSticks() const
Definition: setjoystick.cpp:1107
SetJoystick::disconnectPropertyUpdatedConnection
void disconnectPropertyUpdatedConnection()
Definition: setjoystick.cpp:1033
JoyAxis::disconnectPropertyUpdatedConnection
void disconnectPropertyUpdatedConnection()
Definition: joyaxis.cpp:784
SetJoystick::propogateSetDPadButtonNameChange
void propogateSetDPadButtonNameChange()
Definition: setjoystick.cpp:700
SetJoystick::setButtonNameChange
void setButtonNameChange(int index)
SetJoystickXml
SetJoystick XML serialization/deserialization helper class Reads data from the supplied SetJoystick o...
Definition: setjoystickxml.h:34
JoyButton::setIgnoreEventState
void setIgnoreEventState(bool ignore)
Definition: joybutton.cpp:3519
SetJoystick::vdpads
QHash< int, VDPad * > vdpads
Definition: setjoystick.h:195
SetJoystick::isSetEmpty
bool isSetEmpty()
Check if this set has any mapped event.
Definition: setjoystick.cpp:363
SetJoystick::removeAllBtnFromQueue
void removeAllBtnFromQueue()
Definition: setjoystick.cpp:527
SetJoystick::m_sensors
QHash< JoySensorType, JoySensor * > m_sensors
Definition: setjoystick.h:194
JoySensor::copyAssignments
void copyAssignments(JoySensor *dest_sensor)
Copy slots from all sensor buttons and properties from a sensor onto another.
Definition: joysensor.cpp:168
InputDevice::dpadButtonClickEvent
virtual void dpadButtonClickEvent(int buttonindex)
Definition: inputdevice.cpp:740
SENSOR_COUNT
@ SENSOR_COUNT
Definition: joysensortype.h:30
JoyAxis::getCurrentThrottledDeadValue
int getCurrentThrottledDeadValue()
Definition: joyaxis.cpp:483
JoyAxisButton::setAssignmentChanged
void setAssignmentChanged(int current_button, int axis_index, int associated_set, int mode)
SetJoystick::propogateSetAxisButtonNameChange
void propogateSetAxisButtonNameChange()
Definition: setjoystick.cpp:673
joydpad.h
SetJoystick::SetJoystick
SetJoystick(InputDevice *device, int index, QObject *parent)
Definition: setjoystick.cpp:36
SetJoystick::removeVDPad
void removeVDPad(int index)
Definition: setjoystick.cpp:496
SetJoystick::deleteSensors
void deleteSensors()
Destroy all sensor objects in this set.
Definition: setjoystick.cpp:230
InputDevice::getNumberRawHats
virtual int getNumberRawHats()=0
SetJoystick::establishPropertyUpdatedConnection
void establishPropertyUpdatedConnection()
Definition: setjoystick.cpp:1028
SetJoystick::propagateSetSensorButtonAssociation
void propagateSetSensorButtonAssociation(JoySensorDirection direction, JoySensorType sensor, int newset, int mode)
Forwards set change slot mapping event to InputDevice.
Definition: setjoystick.cpp:296
SetJoystick::enableHatConnections
void enableHatConnections(JoyDPad *dpad)
Definition: setjoystick.cpp:889
JoyAxis::establishPropertyUpdatedConnection
void establishPropertyUpdatedConnection()
Definition: joyaxis.cpp:779
SetJoystick::setName
void setName(QString name)
Definition: setjoystick.cpp:933
JoyControlStick::stickNameChanged
void stickNameChanged()
SetJoystick::getSetLabel
QString getSetLabel()
Definition: setjoystick.cpp:1016
SetJoystick::propogateSetVDPadButtonNameChange
void propogateSetVDPadButtonNameChange()
Definition: setjoystick.cpp:708
JoyButton::buttonNameChanged
void buttonNameChanged()
SetJoystick::propagateSetSensorButtonRelease
void propagateSetSensorButtonRelease(int button)
Definition: setjoystick.cpp:622
JoySensor::getButtons
QHash< JoySensorDirection, JoySensorButton * > * getButtons()
Returns a QHash which maps the SensorDirection to the corresponding JoySensorButton.
Definition: joysensor.cpp:541