11 #include "input/joysticks/JoystickTypes.h" 20 class CDriverPrimitive;
24 class CJoystickFeature;
25 using FeaturePtr = std::shared_ptr<CJoystickFeature>;
104 const FeatureName m_name;
107 const bool m_bEnabled;
110 std::chrono::time_point<std::chrono::steady_clock> m_motionStartTimeMs;
131 void ProcessDigitalMotion();
132 void ProcessAnalogMotion();
135 INPUT_TYPE m_inputType = INPUT_TYPE::UNKNOWN;
136 bool m_bDigitalState =
false;
137 bool m_bInitialPressHandled =
false;
140 float m_analogState = 0.0f;
141 float m_bActivated =
false;
142 bool m_bDiscrete =
true;
199 float GetPosition(
void)
const {
return m_positiveDistance - m_negativeDistance; }
204 void Reset(
void) { m_positiveDistance = m_negativeDistance = 0.0f; }
207 float m_positiveDistance;
208 float m_negativeDistance;
227 float m_state = 0.0f;
237 ~
CWheel()
override =
default;
274 float m_vertState = 0.0f;
275 float m_horizState = 0.0f;
297 float m_xAxisState = 0.0f;
298 float m_yAxisState = 0.0f;
299 float m_zAxisState = 0.0f;
virtual bool OnAnalogMotion(const CDriverPrimitive &source, float magnitude)=0
An analog motion has occurred.
Definition: FeatureHandling.h:259
float GetPosition(void) const
Get the final value of this axis.
Definition: FeatureHandling.h:199
virtual void ProcessMotions(void)=0
Process the motions that have occurred since the last invocation.
void SetNegativeDistance(float distance)
Set value of negative axis.
Definition: FeatureHandling.h:172
Definition: FeatureHandling.h:233
Definition: FeatureHandling.h:246
void Reset(void)
Reset both positive and negative values to zero.
Definition: FeatureHandling.h:204
void StartMotion()
Start the motion timer.
Definition: FeatureHandling.cpp:58
bool AcceptsInput(bool bActivation)
Check if the input handler is accepting input.
Definition: FeatureHandling.cpp:40
Definition: AudioDecoder.h:18
void SetPositiveDistance(float distance)
Set value of positive axis.
Definition: FeatureHandling.h:167
unsigned int MotionTimeMs() const
Get the time for which the feature has been in motion.
Definition: FeatureHandling.cpp:68
Basic driver element associated with input events.
Definition: DriverPrimitive.h:70
void ResetMotion()
Reset motion timer.
Definition: FeatureHandling.cpp:53
Definition: FeatureHandling.h:214
Definition: FeatureHandling.h:116
Axis of a feature (analog stick, accelerometer, etc)
Definition: FeatureHandling.h:159
Definition: FeatureHandling.h:281
Base class for joystick features.
Definition: FeatureHandling.h:34
bool InMotion() const
Check if the feature is in motion.
Definition: FeatureHandling.cpp:63
virtual bool OnDigitalMotion(const CDriverPrimitive &source, bool bPressed)=0
A digital motion has occurred.