summaryrefslogtreecommitdiff
path: root/src/common/input.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/input.h')
-rw-r--r--src/common/input.h70
1 files changed, 43 insertions, 27 deletions
diff --git a/src/common/input.h b/src/common/input.h
index d27b1d772..b5748a6c8 100644
--- a/src/common/input.h
+++ b/src/common/input.h
@@ -51,6 +51,8 @@ enum class PollingMode {
51 NFC, 51 NFC,
52 // Enable infrared camera polling 52 // Enable infrared camera polling
53 IR, 53 IR,
54 // Enable ring controller polling
55 Ring,
54}; 56};
55 57
56enum class CameraFormat { 58enum class CameraFormat {
@@ -62,21 +64,22 @@ enum class CameraFormat {
62 None, 64 None,
63}; 65};
64 66
65// Vibration reply from the controller 67// Different results that can happen from a device request
66enum class VibrationError { 68enum class DriverResult {
67 None, 69 Success,
70 WrongReply,
71 Timeout,
72 UnsupportedControllerType,
73 HandleInUse,
74 ErrorReadingData,
75 ErrorWritingData,
76 NoDeviceDetected,
77 InvalidHandle,
68 NotSupported, 78 NotSupported,
69 Disabled, 79 Disabled,
70 Unknown, 80 Unknown,
71}; 81};
72 82
73// Polling mode reply from the controller
74enum class PollingError {
75 None,
76 NotSupported,
77 Unknown,
78};
79
80// Nfc reply from the controller 83// Nfc reply from the controller
81enum class NfcState { 84enum class NfcState {
82 Success, 85 Success,
@@ -90,13 +93,6 @@ enum class NfcState {
90 Unknown, 93 Unknown,
91}; 94};
92 95
93// Ir camera reply from the controller
94enum class CameraError {
95 None,
96 NotSupported,
97 Unknown,
98};
99
100// Hint for amplification curve to be used 96// Hint for amplification curve to be used
101enum class VibrationAmplificationType { 97enum class VibrationAmplificationType {
102 Linear, 98 Linear,
@@ -134,6 +130,8 @@ struct ButtonStatus {
134 bool inverted{}; 130 bool inverted{};
135 // Press once to activate, press again to release 131 // Press once to activate, press again to release
136 bool toggle{}; 132 bool toggle{};
133 // Spams the button when active
134 bool turbo{};
137 // Internal lock for the toggle status 135 // Internal lock for the toggle status
138 bool locked{}; 136 bool locked{};
139}; 137};
@@ -190,6 +188,8 @@ struct TouchStatus {
190struct BodyColorStatus { 188struct BodyColorStatus {
191 u32 body{}; 189 u32 body{};
192 u32 buttons{}; 190 u32 buttons{};
191 u32 left_grip{};
192 u32 right_grip{};
193}; 193};
194 194
195// HD rumble data 195// HD rumble data
@@ -228,17 +228,31 @@ enum class ButtonNames {
228 Engine, 228 Engine,
229 // This will display the button by value instead of the button name 229 // This will display the button by value instead of the button name
230 Value, 230 Value,
231
232 // Joycon button names
231 ButtonLeft, 233 ButtonLeft,
232 ButtonRight, 234 ButtonRight,
233 ButtonDown, 235 ButtonDown,
234 ButtonUp, 236 ButtonUp,
235 TriggerZ,
236 TriggerR,
237 TriggerL,
238 ButtonA, 237 ButtonA,
239 ButtonB, 238 ButtonB,
240 ButtonX, 239 ButtonX,
241 ButtonY, 240 ButtonY,
241 ButtonPlus,
242 ButtonMinus,
243 ButtonHome,
244 ButtonCapture,
245 ButtonStickL,
246 ButtonStickR,
247 TriggerL,
248 TriggerZL,
249 TriggerSL,
250 TriggerR,
251 TriggerZR,
252 TriggerSR,
253
254 // GC button names
255 TriggerZ,
242 ButtonStart, 256 ButtonStart,
243 257
244 // DS4 button names 258 // DS4 button names
@@ -316,22 +330,24 @@ class OutputDevice {
316public: 330public:
317 virtual ~OutputDevice() = default; 331 virtual ~OutputDevice() = default;
318 332
319 virtual void SetLED([[maybe_unused]] const LedStatus& led_status) {} 333 virtual DriverResult SetLED([[maybe_unused]] const LedStatus& led_status) {
334 return DriverResult::NotSupported;
335 }
320 336
321 virtual VibrationError SetVibration([[maybe_unused]] const VibrationStatus& vibration_status) { 337 virtual DriverResult SetVibration([[maybe_unused]] const VibrationStatus& vibration_status) {
322 return VibrationError::NotSupported; 338 return DriverResult::NotSupported;
323 } 339 }
324 340
325 virtual bool IsVibrationEnabled() { 341 virtual bool IsVibrationEnabled() {
326 return false; 342 return false;
327 } 343 }
328 344
329 virtual PollingError SetPollingMode([[maybe_unused]] PollingMode polling_mode) { 345 virtual DriverResult SetPollingMode([[maybe_unused]] PollingMode polling_mode) {
330 return PollingError::NotSupported; 346 return DriverResult::NotSupported;
331 } 347 }
332 348
333 virtual CameraError SetCameraFormat([[maybe_unused]] CameraFormat camera_format) { 349 virtual DriverResult SetCameraFormat([[maybe_unused]] CameraFormat camera_format) {
334 return CameraError::NotSupported; 350 return DriverResult::NotSupported;
335 } 351 }
336 352
337 virtual NfcState SupportsNfc() const { 353 virtual NfcState SupportsNfc() const {