diff options
Diffstat (limited to 'src/input_common/input_engine.h')
| -rw-r--r-- | src/input_common/input_engine.h | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/src/input_common/input_engine.h b/src/input_common/input_engine.h index fe2faee5a..741334aed 100644 --- a/src/input_common/input_engine.h +++ b/src/input_common/input_engine.h | |||
| @@ -34,16 +34,6 @@ struct BasicMotion { | |||
| 34 | u64 delta_timestamp{}; | 34 | u64 delta_timestamp{}; |
| 35 | }; | 35 | }; |
| 36 | 36 | ||
| 37 | // Stages of a battery charge | ||
| 38 | enum class BatteryLevel { | ||
| 39 | Empty, | ||
| 40 | Critical, | ||
| 41 | Low, | ||
| 42 | Medium, | ||
| 43 | Full, | ||
| 44 | Charging, | ||
| 45 | }; | ||
| 46 | |||
| 47 | // Types of input that are stored in the engine | 37 | // Types of input that are stored in the engine |
| 48 | enum class EngineInputType { | 38 | enum class EngineInputType { |
| 49 | None, | 39 | None, |
| @@ -178,7 +168,7 @@ public: | |||
| 178 | bool GetButton(const PadIdentifier& identifier, int button) const; | 168 | bool GetButton(const PadIdentifier& identifier, int button) const; |
| 179 | bool GetHatButton(const PadIdentifier& identifier, int button, u8 direction) const; | 169 | bool GetHatButton(const PadIdentifier& identifier, int button, u8 direction) const; |
| 180 | f32 GetAxis(const PadIdentifier& identifier, int axis) const; | 170 | f32 GetAxis(const PadIdentifier& identifier, int axis) const; |
| 181 | BatteryLevel GetBattery(const PadIdentifier& identifier) const; | 171 | Common::Input::BatteryLevel GetBattery(const PadIdentifier& identifier) const; |
| 182 | BasicMotion GetMotion(const PadIdentifier& identifier, int motion) const; | 172 | BasicMotion GetMotion(const PadIdentifier& identifier, int motion) const; |
| 183 | 173 | ||
| 184 | int SetCallback(InputIdentifier input_identifier); | 174 | int SetCallback(InputIdentifier input_identifier); |
| @@ -189,7 +179,7 @@ protected: | |||
| 189 | void SetButton(const PadIdentifier& identifier, int button, bool value); | 179 | void SetButton(const PadIdentifier& identifier, int button, bool value); |
| 190 | void SetHatButton(const PadIdentifier& identifier, int button, u8 value); | 180 | void SetHatButton(const PadIdentifier& identifier, int button, u8 value); |
| 191 | void SetAxis(const PadIdentifier& identifier, int axis, f32 value); | 181 | void SetAxis(const PadIdentifier& identifier, int axis, f32 value); |
| 192 | void SetBattery(const PadIdentifier& identifier, BatteryLevel value); | 182 | void SetBattery(const PadIdentifier& identifier, Common::Input::BatteryLevel value); |
| 193 | void SetMotion(const PadIdentifier& identifier, int motion, const BasicMotion& value); | 183 | void SetMotion(const PadIdentifier& identifier, int motion, const BasicMotion& value); |
| 194 | 184 | ||
| 195 | virtual std::string GetHatButtonName([[maybe_unused]] u8 direction_value) const { | 185 | virtual std::string GetHatButtonName([[maybe_unused]] u8 direction_value) const { |
| @@ -202,13 +192,13 @@ private: | |||
| 202 | std::unordered_map<int, u8> hat_buttons; | 192 | std::unordered_map<int, u8> hat_buttons; |
| 203 | std::unordered_map<int, float> axes; | 193 | std::unordered_map<int, float> axes; |
| 204 | std::unordered_map<int, BasicMotion> motions; | 194 | std::unordered_map<int, BasicMotion> motions; |
| 205 | BatteryLevel battery{}; | 195 | Common::Input::BatteryLevel battery{}; |
| 206 | }; | 196 | }; |
| 207 | 197 | ||
| 208 | void TriggerOnButtonChange(const PadIdentifier& identifier, int button, bool value); | 198 | void TriggerOnButtonChange(const PadIdentifier& identifier, int button, bool value); |
| 209 | void TriggerOnHatButtonChange(const PadIdentifier& identifier, int button, u8 value); | 199 | void TriggerOnHatButtonChange(const PadIdentifier& identifier, int button, u8 value); |
| 210 | void TriggerOnAxisChange(const PadIdentifier& identifier, int axis, f32 value); | 200 | void TriggerOnAxisChange(const PadIdentifier& identifier, int axis, f32 value); |
| 211 | void TriggerOnBatteryChange(const PadIdentifier& identifier, BatteryLevel value); | 201 | void TriggerOnBatteryChange(const PadIdentifier& identifier, Common::Input::BatteryLevel value); |
| 212 | void TriggerOnMotionChange(const PadIdentifier& identifier, int motion, | 202 | void TriggerOnMotionChange(const PadIdentifier& identifier, int motion, |
| 213 | const BasicMotion& value); | 203 | const BasicMotion& value); |
| 214 | 204 | ||