summaryrefslogtreecommitdiff
path: root/src/common/input.h
diff options
context:
space:
mode:
authorGravatar german772021-10-11 00:43:11 -0500
committerGravatar Narr the Reg2021-11-24 20:30:24 -0600
commit06a5ef5874144a70e30e577a83ba68d1dad79e78 (patch)
tree867fa1153c7285c858cdb5bd7f60f08266532a88 /src/common/input.h
parentcore: Update input interpreter (diff)
downloadyuzu-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.h39
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
41enum class PollingMode {
42 Active,
43 Pasive,
44 Camera,
45 NCF,
46 IR,
47};
48
49enum class VibrationError {
50 None,
51 NotSupported,
52 Disabled,
53 Unknown,
54};
55
56enum class PollingError {
57 None,
58 NotSupported,
59 Unknown,
60};
61
41struct AnalogProperties { 62struct 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).
174class OutputDevice {
175public:
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.
153template <typename InputDeviceType> 192template <typename InputDeviceType>
154class Factory { 193class Factory {