diff options
| author | 2021-10-11 00:43:11 -0500 | |
|---|---|---|
| committer | 2021-11-24 20:30:24 -0600 | |
| commit | 06a5ef5874144a70e30e577a83ba68d1dad79e78 (patch) | |
| tree | 867fa1153c7285c858cdb5bd7f60f08266532a88 /src/common/input.h | |
| parent | core: Update input interpreter (diff) | |
| download | yuzu-06a5ef5874144a70e30e577a83ba68d1dad79e78.tar.gz yuzu-06a5ef5874144a70e30e577a83ba68d1dad79e78.tar.xz yuzu-06a5ef5874144a70e30e577a83ba68d1dad79e78.zip | |
core/hid: Add output devices
Diffstat (limited to 'src/common/input.h')
| -rw-r--r-- | src/common/input.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/common/input.h b/src/common/input.h index 6eefc55f9..3a28b77a7 100644 --- a/src/common/input.h +++ b/src/common/input.h | |||
| @@ -38,6 +38,27 @@ enum class BatteryLevel { | |||
| 38 | Charging, | 38 | Charging, |
| 39 | }; | 39 | }; |
| 40 | 40 | ||
| 41 | enum class PollingMode { | ||
| 42 | Active, | ||
| 43 | Pasive, | ||
| 44 | Camera, | ||
| 45 | NCF, | ||
| 46 | IR, | ||
| 47 | }; | ||
| 48 | |||
| 49 | enum class VibrationError { | ||
| 50 | None, | ||
| 51 | NotSupported, | ||
| 52 | Disabled, | ||
| 53 | Unknown, | ||
| 54 | }; | ||
| 55 | |||
| 56 | enum class PollingError { | ||
| 57 | None, | ||
| 58 | NotSupported, | ||
| 59 | Unknown, | ||
| 60 | }; | ||
| 61 | |||
| 41 | struct AnalogProperties { | 62 | struct AnalogProperties { |
| 42 | float deadzone{}; | 63 | float deadzone{}; |
| 43 | float range{1.0f}; | 64 | float range{1.0f}; |
| @@ -149,6 +170,24 @@ private: | |||
| 149 | InputCallback callback; | 170 | InputCallback callback; |
| 150 | }; | 171 | }; |
| 151 | 172 | ||
| 173 | /// An abstract class template for an output device (rumble, LED pattern, polling mode). | ||
| 174 | class OutputDevice { | ||
| 175 | public: | ||
| 176 | virtual ~OutputDevice() = default; | ||
| 177 | |||
| 178 | virtual void SetLED([[maybe_unused]] LedStatus led_status) { | ||
| 179 | return; | ||
| 180 | } | ||
| 181 | |||
| 182 | virtual VibrationError SetVibration([[maybe_unused]] VibrationStatus vibration_status) { | ||
| 183 | return VibrationError::NotSupported; | ||
| 184 | } | ||
| 185 | |||
| 186 | virtual PollingError SetPollingMode([[maybe_unused]] PollingMode polling_mode) { | ||
| 187 | return PollingError::NotSupported; | ||
| 188 | } | ||
| 189 | }; | ||
| 190 | |||
| 152 | /// An abstract class template for a factory that can create input devices. | 191 | /// An abstract class template for a factory that can create input devices. |
| 153 | template <typename InputDeviceType> | 192 | template <typename InputDeviceType> |
| 154 | class Factory { | 193 | class Factory { |