diff options
Diffstat (limited to 'src/input_common/input_engine.h')
| -rw-r--r-- | src/input_common/input_engine.h | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/src/input_common/input_engine.h b/src/input_common/input_engine.h index 6cbcf5207..50b5a3dc8 100644 --- a/src/input_common/input_engine.h +++ b/src/input_common/input_engine.h | |||
| @@ -40,6 +40,7 @@ enum class EngineInputType { | |||
| 40 | Battery, | 40 | Battery, |
| 41 | Button, | 41 | Button, |
| 42 | Camera, | 42 | Camera, |
| 43 | Color, | ||
| 43 | HatButton, | 44 | HatButton, |
| 44 | Motion, | 45 | Motion, |
| 45 | Nfc, | 46 | Nfc, |
| @@ -104,14 +105,17 @@ public: | |||
| 104 | void EndConfiguration(); | 105 | void EndConfiguration(); |
| 105 | 106 | ||
| 106 | // Sets a led pattern for a controller | 107 | // Sets a led pattern for a controller |
| 107 | virtual void SetLeds([[maybe_unused]] const PadIdentifier& identifier, | 108 | virtual Common::Input::DriverResult SetLeds( |
| 108 | [[maybe_unused]] const Common::Input::LedStatus& led_status) {} | 109 | [[maybe_unused]] const PadIdentifier& identifier, |
| 110 | [[maybe_unused]] const Common::Input::LedStatus& led_status) { | ||
| 111 | return Common::Input::DriverResult::NotSupported; | ||
| 112 | } | ||
| 109 | 113 | ||
| 110 | // Sets rumble to a controller | 114 | // Sets rumble to a controller |
| 111 | virtual Common::Input::VibrationError SetVibration( | 115 | virtual Common::Input::DriverResult SetVibration( |
| 112 | [[maybe_unused]] const PadIdentifier& identifier, | 116 | [[maybe_unused]] const PadIdentifier& identifier, |
| 113 | [[maybe_unused]] const Common::Input::VibrationStatus& vibration) { | 117 | [[maybe_unused]] const Common::Input::VibrationStatus& vibration) { |
| 114 | return Common::Input::VibrationError::NotSupported; | 118 | return Common::Input::DriverResult::NotSupported; |
| 115 | } | 119 | } |
| 116 | 120 | ||
| 117 | // Returns true if device supports vibrations | 121 | // Returns true if device supports vibrations |
| @@ -120,17 +124,17 @@ public: | |||
| 120 | } | 124 | } |
| 121 | 125 | ||
| 122 | // Sets polling mode to a controller | 126 | // Sets polling mode to a controller |
| 123 | virtual Common::Input::PollingError SetPollingMode( | 127 | virtual Common::Input::DriverResult SetPollingMode( |
| 124 | [[maybe_unused]] const PadIdentifier& identifier, | 128 | [[maybe_unused]] const PadIdentifier& identifier, |
| 125 | [[maybe_unused]] const Common::Input::PollingMode polling_mode) { | 129 | [[maybe_unused]] const Common::Input::PollingMode polling_mode) { |
| 126 | return Common::Input::PollingError::NotSupported; | 130 | return Common::Input::DriverResult::NotSupported; |
| 127 | } | 131 | } |
| 128 | 132 | ||
| 129 | // Sets camera format to a controller | 133 | // Sets camera format to a controller |
| 130 | virtual Common::Input::CameraError SetCameraFormat( | 134 | virtual Common::Input::DriverResult SetCameraFormat( |
| 131 | [[maybe_unused]] const PadIdentifier& identifier, | 135 | [[maybe_unused]] const PadIdentifier& identifier, |
| 132 | [[maybe_unused]] Common::Input::CameraFormat camera_format) { | 136 | [[maybe_unused]] Common::Input::CameraFormat camera_format) { |
| 133 | return Common::Input::CameraError::NotSupported; | 137 | return Common::Input::DriverResult::NotSupported; |
| 134 | } | 138 | } |
| 135 | 139 | ||
| 136 | // Returns success if nfc is supported | 140 | // Returns success if nfc is supported |
| @@ -199,6 +203,7 @@ public: | |||
| 199 | bool GetHatButton(const PadIdentifier& identifier, int button, u8 direction) const; | 203 | bool GetHatButton(const PadIdentifier& identifier, int button, u8 direction) const; |
| 200 | f32 GetAxis(const PadIdentifier& identifier, int axis) const; | 204 | f32 GetAxis(const PadIdentifier& identifier, int axis) const; |
| 201 | Common::Input::BatteryLevel GetBattery(const PadIdentifier& identifier) const; | 205 | Common::Input::BatteryLevel GetBattery(const PadIdentifier& identifier) const; |
| 206 | Common::Input::BodyColorStatus GetColor(const PadIdentifier& identifier) const; | ||
| 202 | BasicMotion GetMotion(const PadIdentifier& identifier, int motion) const; | 207 | BasicMotion GetMotion(const PadIdentifier& identifier, int motion) const; |
| 203 | Common::Input::CameraStatus GetCamera(const PadIdentifier& identifier) const; | 208 | Common::Input::CameraStatus GetCamera(const PadIdentifier& identifier) const; |
| 204 | Common::Input::NfcStatus GetNfc(const PadIdentifier& identifier) const; | 209 | Common::Input::NfcStatus GetNfc(const PadIdentifier& identifier) const; |
| @@ -212,6 +217,7 @@ protected: | |||
| 212 | void SetHatButton(const PadIdentifier& identifier, int button, u8 value); | 217 | void SetHatButton(const PadIdentifier& identifier, int button, u8 value); |
| 213 | void SetAxis(const PadIdentifier& identifier, int axis, f32 value); | 218 | void SetAxis(const PadIdentifier& identifier, int axis, f32 value); |
| 214 | void SetBattery(const PadIdentifier& identifier, Common::Input::BatteryLevel value); | 219 | void SetBattery(const PadIdentifier& identifier, Common::Input::BatteryLevel value); |
| 220 | void SetColor(const PadIdentifier& identifier, Common::Input::BodyColorStatus value); | ||
| 215 | void SetMotion(const PadIdentifier& identifier, int motion, const BasicMotion& value); | 221 | void SetMotion(const PadIdentifier& identifier, int motion, const BasicMotion& value); |
| 216 | void SetCamera(const PadIdentifier& identifier, const Common::Input::CameraStatus& value); | 222 | void SetCamera(const PadIdentifier& identifier, const Common::Input::CameraStatus& value); |
| 217 | void SetNfc(const PadIdentifier& identifier, const Common::Input::NfcStatus& value); | 223 | void SetNfc(const PadIdentifier& identifier, const Common::Input::NfcStatus& value); |
| @@ -227,6 +233,7 @@ private: | |||
| 227 | std::unordered_map<int, float> axes; | 233 | std::unordered_map<int, float> axes; |
| 228 | std::unordered_map<int, BasicMotion> motions; | 234 | std::unordered_map<int, BasicMotion> motions; |
| 229 | Common::Input::BatteryLevel battery{}; | 235 | Common::Input::BatteryLevel battery{}; |
| 236 | Common::Input::BodyColorStatus color{}; | ||
| 230 | Common::Input::CameraStatus camera{}; | 237 | Common::Input::CameraStatus camera{}; |
| 231 | Common::Input::NfcStatus nfc{}; | 238 | Common::Input::NfcStatus nfc{}; |
| 232 | }; | 239 | }; |
| @@ -235,6 +242,8 @@ private: | |||
| 235 | void TriggerOnHatButtonChange(const PadIdentifier& identifier, int button, u8 value); | 242 | void TriggerOnHatButtonChange(const PadIdentifier& identifier, int button, u8 value); |
| 236 | void TriggerOnAxisChange(const PadIdentifier& identifier, int axis, f32 value); | 243 | void TriggerOnAxisChange(const PadIdentifier& identifier, int axis, f32 value); |
| 237 | void TriggerOnBatteryChange(const PadIdentifier& identifier, Common::Input::BatteryLevel value); | 244 | void TriggerOnBatteryChange(const PadIdentifier& identifier, Common::Input::BatteryLevel value); |
| 245 | void TriggerOnColorChange(const PadIdentifier& identifier, | ||
| 246 | Common::Input::BodyColorStatus value); | ||
| 238 | void TriggerOnMotionChange(const PadIdentifier& identifier, int motion, | 247 | void TriggerOnMotionChange(const PadIdentifier& identifier, int motion, |
| 239 | const BasicMotion& value); | 248 | const BasicMotion& value); |
| 240 | void TriggerOnCameraChange(const PadIdentifier& identifier, | 249 | void TriggerOnCameraChange(const PadIdentifier& identifier, |