20 class CDriverPrimitive;
24 class CJoystickFeature;
25 using FeaturePtr = std::shared_ptr<CJoystickFeature>;
106 const bool m_bEnabled;
109 std::chrono::time_point<std::chrono::steady_clock> m_motionStartTimeMs;
127 void ProcessDigitalMotion();
128 void ProcessAnalogMotion();
132 bool m_bDigitalState;
133 bool m_bInitialPressHandled =
false;
194 float GetPosition(
void)
const {
return m_positiveDistance - m_negativeDistance; }
199 void Reset(
void) { m_positiveDistance = m_negativeDistance = 0.0f; }
202 float m_positiveDistance;
203 float m_negativeDistance;
226 ~
CWheel()
override =
default;
INPUT_TYPE
Types of input available for scalar features.
Definition: JoystickTypes.h:140
virtual bool OnAnalogMotion(const CDriverPrimitive &source, float magnitude)=0
An analog motion has occurred.
Definition: FeatureHandling.h:242
float GetPosition(void) const
Get the final value of this axis.
Definition: FeatureHandling.h:194
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:167
Definition: FeatureHandling.h:222
Definition: FeatureHandling.h:232
void Reset(void)
Reset both positive and negative values to zero.
Definition: FeatureHandling.h:199
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
Controller configuration window.
Definition: AudioDecoder.h:18
void SetPositiveDistance(float distance)
Set value of positive axis.
Definition: FeatureHandling.h:162
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:69
void ResetMotion()
Reset motion timer.
Definition: FeatureHandling.cpp:53
std::string FeatureName
Name of a physical feature belonging to the joystick.
Definition: JoystickTypes.h:28
Definition: FeatureHandling.h:206
Definition: FeatureHandling.h:112
Axis of a feature (analog stick, accelerometer, etc)
Definition: FeatureHandling.h:154
Definition: FeatureHandling.h:261
Base class for joystick features.
Definition: FeatureHandling.h:33
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.