diff options
Diffstat (limited to '')
| -rw-r--r-- | src/input_common/input_engine.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/input_common/input_engine.h b/src/input_common/input_engine.h index f6b3c4610..cfbdb26bd 100644 --- a/src/input_common/input_engine.h +++ b/src/input_common/input_engine.h | |||
| @@ -42,6 +42,7 @@ enum class EngineInputType { | |||
| 42 | Camera, | 42 | Camera, |
| 43 | HatButton, | 43 | HatButton, |
| 44 | Motion, | 44 | Motion, |
| 45 | Nfc, | ||
| 45 | }; | 46 | }; |
| 46 | 47 | ||
| 47 | namespace std { | 48 | namespace std { |
| @@ -127,6 +128,18 @@ public: | |||
| 127 | return Common::Input::CameraError::NotSupported; | 128 | return Common::Input::CameraError::NotSupported; |
| 128 | } | 129 | } |
| 129 | 130 | ||
| 131 | // Request nfc data from a controller | ||
| 132 | virtual Common::Input::NfcState SupportsNfc( | ||
| 133 | [[maybe_unused]] const PadIdentifier& identifier) const { | ||
| 134 | return Common::Input::NfcState::NotSupported; | ||
| 135 | } | ||
| 136 | |||
| 137 | // Writes data to an nfc tag | ||
| 138 | virtual Common::Input::NfcState WriteNfcData([[maybe_unused]] const PadIdentifier& identifier, | ||
| 139 | [[maybe_unused]] const std::vector<u8>& data) { | ||
| 140 | return Common::Input::NfcState::NotSupported; | ||
| 141 | } | ||
| 142 | |||
| 130 | // Returns the engine name | 143 | // Returns the engine name |
| 131 | [[nodiscard]] const std::string& GetEngineName() const; | 144 | [[nodiscard]] const std::string& GetEngineName() const; |
| 132 | 145 | ||
| @@ -183,6 +196,7 @@ public: | |||
| 183 | Common::Input::BatteryLevel GetBattery(const PadIdentifier& identifier) const; | 196 | Common::Input::BatteryLevel GetBattery(const PadIdentifier& identifier) const; |
| 184 | BasicMotion GetMotion(const PadIdentifier& identifier, int motion) const; | 197 | BasicMotion GetMotion(const PadIdentifier& identifier, int motion) const; |
| 185 | Common::Input::CameraStatus GetCamera(const PadIdentifier& identifier) const; | 198 | Common::Input::CameraStatus GetCamera(const PadIdentifier& identifier) const; |
| 199 | Common::Input::NfcStatus GetNfc(const PadIdentifier& identifier) const; | ||
| 186 | 200 | ||
| 187 | int SetCallback(InputIdentifier input_identifier); | 201 | int SetCallback(InputIdentifier input_identifier); |
| 188 | void SetMappingCallback(MappingCallback callback); | 202 | void SetMappingCallback(MappingCallback callback); |
| @@ -195,6 +209,7 @@ protected: | |||
| 195 | void SetBattery(const PadIdentifier& identifier, Common::Input::BatteryLevel value); | 209 | void SetBattery(const PadIdentifier& identifier, Common::Input::BatteryLevel value); |
| 196 | void SetMotion(const PadIdentifier& identifier, int motion, const BasicMotion& value); | 210 | void SetMotion(const PadIdentifier& identifier, int motion, const BasicMotion& value); |
| 197 | void SetCamera(const PadIdentifier& identifier, const Common::Input::CameraStatus& value); | 211 | void SetCamera(const PadIdentifier& identifier, const Common::Input::CameraStatus& value); |
| 212 | void SetNfc(const PadIdentifier& identifier, const Common::Input::NfcStatus& value); | ||
| 198 | 213 | ||
| 199 | virtual std::string GetHatButtonName([[maybe_unused]] u8 direction_value) const { | 214 | virtual std::string GetHatButtonName([[maybe_unused]] u8 direction_value) const { |
| 200 | return "Unknown"; | 215 | return "Unknown"; |
| @@ -208,6 +223,7 @@ private: | |||
| 208 | std::unordered_map<int, BasicMotion> motions; | 223 | std::unordered_map<int, BasicMotion> motions; |
| 209 | Common::Input::BatteryLevel battery{}; | 224 | Common::Input::BatteryLevel battery{}; |
| 210 | Common::Input::CameraStatus camera{}; | 225 | Common::Input::CameraStatus camera{}; |
| 226 | Common::Input::NfcStatus nfc{}; | ||
| 211 | }; | 227 | }; |
| 212 | 228 | ||
| 213 | void TriggerOnButtonChange(const PadIdentifier& identifier, int button, bool value); | 229 | void TriggerOnButtonChange(const PadIdentifier& identifier, int button, bool value); |
| @@ -218,6 +234,7 @@ private: | |||
| 218 | const BasicMotion& value); | 234 | const BasicMotion& value); |
| 219 | void TriggerOnCameraChange(const PadIdentifier& identifier, | 235 | void TriggerOnCameraChange(const PadIdentifier& identifier, |
| 220 | const Common::Input::CameraStatus& value); | 236 | const Common::Input::CameraStatus& value); |
| 237 | void TriggerOnNfcChange(const PadIdentifier& identifier, const Common::Input::NfcStatus& value); | ||
| 221 | 238 | ||
| 222 | bool IsInputIdentifierEqual(const InputIdentifier& input_identifier, | 239 | bool IsInputIdentifierEqual(const InputIdentifier& input_identifier, |
| 223 | const PadIdentifier& identifier, EngineInputType type, | 240 | const PadIdentifier& identifier, EngineInputType type, |