diff options
author | liamwhite <liamwhite@users.noreply.github.com> | 2023-01-24 15:29:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-24 15:29:37 +0100 |
commit | a68af583ea378b48e2ed5a19f519a815ba89e40f (patch) | |
tree | 2983c14a7d4bc2797259c7d97462a439bec629f3 /src/common | |
parent | Merge pull request #9555 from abouvier/catch2-update (diff) | |
parent | core: hid: Make use of SCOPE_EXIT and SCOPE_GUARD where applicable (diff) | |
download | yuzu-a68af583ea378b48e2ed5a19f519a815ba89e40f.tar yuzu-a68af583ea378b48e2ed5a19f519a815ba89e40f.tar.gz yuzu-a68af583ea378b48e2ed5a19f519a815ba89e40f.tar.bz2 yuzu-a68af583ea378b48e2ed5a19f519a815ba89e40f.tar.lz yuzu-a68af583ea378b48e2ed5a19f519a815ba89e40f.tar.xz yuzu-a68af583ea378b48e2ed5a19f519a815ba89e40f.tar.zst yuzu-a68af583ea378b48e2ed5a19f519a815ba89e40f.zip |
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/input.h | 68 | ||||
-rw-r--r-- | src/common/settings.h | 1 |
2 files changed, 42 insertions, 27 deletions
diff --git a/src/common/input.h b/src/common/input.h index d27b1d772..d61cd7ca8 100644 --- a/src/common/input.h +++ b/src/common/input.h @@ -51,6 +51,8 @@ enum class PollingMode { NFC, // Enable infrared camera polling IR, + // Enable ring controller polling + Ring, }; enum class CameraFormat { @@ -62,21 +64,22 @@ enum class CameraFormat { None, }; -// Vibration reply from the controller -enum class VibrationError { - None, +// Different results that can happen from a device request +enum class DriverResult { + Success, + WrongReply, + Timeout, + UnsupportedControllerType, + HandleInUse, + ErrorReadingData, + ErrorWritingData, + NoDeviceDetected, + InvalidHandle, NotSupported, Disabled, Unknown, }; -// Polling mode reply from the controller -enum class PollingError { - None, - NotSupported, - Unknown, -}; - // Nfc reply from the controller enum class NfcState { Success, @@ -90,13 +93,6 @@ enum class NfcState { Unknown, }; -// Ir camera reply from the controller -enum class CameraError { - None, - NotSupported, - Unknown, -}; - // Hint for amplification curve to be used enum class VibrationAmplificationType { Linear, @@ -190,6 +186,8 @@ struct TouchStatus { struct BodyColorStatus { u32 body{}; u32 buttons{}; + u32 left_grip{}; + u32 right_grip{}; }; // HD rumble data @@ -228,17 +226,31 @@ enum class ButtonNames { Engine, // This will display the button by value instead of the button name Value, + + // Joycon button names ButtonLeft, ButtonRight, ButtonDown, ButtonUp, - TriggerZ, - TriggerR, - TriggerL, ButtonA, ButtonB, ButtonX, ButtonY, + ButtonPlus, + ButtonMinus, + ButtonHome, + ButtonCapture, + ButtonStickL, + ButtonStickR, + TriggerL, + TriggerZL, + TriggerSL, + TriggerR, + TriggerZR, + TriggerSR, + + // GC button names + TriggerZ, ButtonStart, // DS4 button names @@ -316,22 +328,24 @@ class OutputDevice { public: virtual ~OutputDevice() = default; - virtual void SetLED([[maybe_unused]] const LedStatus& led_status) {} + virtual DriverResult SetLED([[maybe_unused]] const LedStatus& led_status) { + return DriverResult::NotSupported; + } - virtual VibrationError SetVibration([[maybe_unused]] const VibrationStatus& vibration_status) { - return VibrationError::NotSupported; + virtual DriverResult SetVibration([[maybe_unused]] const VibrationStatus& vibration_status) { + return DriverResult::NotSupported; } virtual bool IsVibrationEnabled() { return false; } - virtual PollingError SetPollingMode([[maybe_unused]] PollingMode polling_mode) { - return PollingError::NotSupported; + virtual DriverResult SetPollingMode([[maybe_unused]] PollingMode polling_mode) { + return DriverResult::NotSupported; } - virtual CameraError SetCameraFormat([[maybe_unused]] CameraFormat camera_format) { - return CameraError::NotSupported; + virtual DriverResult SetCameraFormat([[maybe_unused]] CameraFormat camera_format) { + return DriverResult::NotSupported; } virtual NfcState SupportsNfc() const { diff --git a/src/common/settings.h b/src/common/settings.h index 80b2eeabc..4b4da4da2 100644 --- a/src/common/settings.h +++ b/src/common/settings.h @@ -483,6 +483,7 @@ struct Values { Setting<bool> enable_raw_input{false, "enable_raw_input"}; Setting<bool> controller_navigation{true, "controller_navigation"}; + Setting<bool> enable_joycon_driver{true, "enable_joycon_driver"}; SwitchableSetting<bool> vibration_enabled{true, "vibration_enabled"}; SwitchableSetting<bool> enable_accurate_vibrations{false, "enable_accurate_vibrations"}; |