diff options
| author | 2023-03-05 12:44:39 -0600 | |
|---|---|---|
| committer | 2023-03-05 12:50:15 -0600 | |
| commit | 97704b8da9866a4e529515f5793309ce5f199840 (patch) | |
| tree | 7bc99ea037a05cce9342866378eca6ce8deecf0f /src/input_common/helpers/joycon_protocol/poller.h | |
| parent | Merge pull request #9786 from FernandoS27/the-gaia-is-a-lie (diff) | |
| download | yuzu-97704b8da9866a4e529515f5793309ce5f199840.tar.gz yuzu-97704b8da9866a4e529515f5793309ce5f199840.tar.xz yuzu-97704b8da9866a4e529515f5793309ce5f199840.zip | |
input_common: joycon: Add stick input from passive reports
Diffstat (limited to 'src/input_common/helpers/joycon_protocol/poller.h')
| -rw-r--r-- | src/input_common/helpers/joycon_protocol/poller.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/input_common/helpers/joycon_protocol/poller.h b/src/input_common/helpers/joycon_protocol/poller.h index 354d41dad..5c897f070 100644 --- a/src/input_common/helpers/joycon_protocol/poller.h +++ b/src/input_common/helpers/joycon_protocol/poller.h | |||
| @@ -22,7 +22,7 @@ public: | |||
| 22 | JoyStickCalibration right_stick_calibration_, | 22 | JoyStickCalibration right_stick_calibration_, |
| 23 | MotionCalibration motion_calibration_); | 23 | MotionCalibration motion_calibration_); |
| 24 | 24 | ||
| 25 | void SetCallbacks(const Joycon::JoyconCallbacks& callbacks_); | 25 | void SetCallbacks(const JoyconCallbacks& callbacks_); |
| 26 | 26 | ||
| 27 | /// Handles data from passive packages | 27 | /// Handles data from passive packages |
| 28 | void ReadPassiveMode(std::span<u8> buffer); | 28 | void ReadPassiveMode(std::span<u8> buffer); |
| @@ -51,7 +51,10 @@ private: | |||
| 51 | void UpdatePasiveProPadInput(const InputReportPassive& buffer); | 51 | void UpdatePasiveProPadInput(const InputReportPassive& buffer); |
| 52 | 52 | ||
| 53 | /// Returns a calibrated joystick axis from raw axis data | 53 | /// Returns a calibrated joystick axis from raw axis data |
| 54 | f32 GetAxisValue(u16 raw_value, Joycon::JoyStickAxisCalibration calibration) const; | 54 | f32 GetAxisValue(u16 raw_value, JoyStickAxisCalibration calibration) const; |
| 55 | |||
| 56 | /// Returns a digital joystick axis from passive axis data | ||
| 57 | std::pair<f32, f32> GetPassiveAxisValue(PasivePadStick raw_value) const; | ||
| 55 | 58 | ||
| 56 | /// Returns a calibrated accelerometer axis from raw motion data | 59 | /// Returns a calibrated accelerometer axis from raw motion data |
| 57 | f32 GetAccelerometerValue(s16 raw, const MotionSensorCalibration& cal, | 60 | f32 GetAccelerometerValue(s16 raw, const MotionSensorCalibration& cal, |
| @@ -75,7 +78,7 @@ private: | |||
| 75 | JoyStickCalibration right_stick_calibration{}; | 78 | JoyStickCalibration right_stick_calibration{}; |
| 76 | MotionCalibration motion_calibration{}; | 79 | MotionCalibration motion_calibration{}; |
| 77 | 80 | ||
| 78 | Joycon::JoyconCallbacks callbacks{}; | 81 | JoyconCallbacks callbacks{}; |
| 79 | }; | 82 | }; |
| 80 | 83 | ||
| 81 | } // namespace InputCommon::Joycon | 84 | } // namespace InputCommon::Joycon |