diff options
Diffstat (limited to 'src/core/hid/input_converter.h')
| -rw-r--r-- | src/core/hid/input_converter.h | 119 |
1 files changed, 0 insertions, 119 deletions
diff --git a/src/core/hid/input_converter.h b/src/core/hid/input_converter.h deleted file mode 100644 index c51c03e57..000000000 --- a/src/core/hid/input_converter.h +++ /dev/null | |||
| @@ -1,119 +0,0 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
| 3 | |||
| 4 | #pragma once | ||
| 5 | |||
| 6 | namespace Common::Input { | ||
| 7 | struct CallbackStatus; | ||
| 8 | enum class BatteryLevel : u32; | ||
| 9 | using BatteryStatus = BatteryLevel; | ||
| 10 | struct AnalogStatus; | ||
| 11 | struct ButtonStatus; | ||
| 12 | struct MotionStatus; | ||
| 13 | struct StickStatus; | ||
| 14 | struct TouchStatus; | ||
| 15 | struct TriggerStatus; | ||
| 16 | }; // namespace Common::Input | ||
| 17 | |||
| 18 | namespace Core::HID { | ||
| 19 | |||
| 20 | /** | ||
| 21 | * Converts raw input data into a valid battery status. | ||
| 22 | * | ||
| 23 | * @param callback Supported callbacks: Analog, Battery, Trigger. | ||
| 24 | * @return A valid BatteryStatus object. | ||
| 25 | */ | ||
| 26 | Common::Input::BatteryStatus TransformToBattery(const Common::Input::CallbackStatus& callback); | ||
| 27 | |||
| 28 | /** | ||
| 29 | * Converts raw input data into a valid button status. Applies invert properties to the output. | ||
| 30 | * | ||
| 31 | * @param callback Supported callbacks: Analog, Button, Trigger. | ||
| 32 | * @return A valid TouchStatus object. | ||
| 33 | */ | ||
| 34 | Common::Input::ButtonStatus TransformToButton(const Common::Input::CallbackStatus& callback); | ||
| 35 | |||
| 36 | /** | ||
| 37 | * Converts raw input data into a valid motion status. | ||
| 38 | * | ||
| 39 | * @param callback Supported callbacks: Motion. | ||
| 40 | * @return A valid TouchStatus object. | ||
| 41 | */ | ||
| 42 | Common::Input::MotionStatus TransformToMotion(const Common::Input::CallbackStatus& callback); | ||
| 43 | |||
| 44 | /** | ||
| 45 | * Converts raw input data into a valid stick status. Applies offset, deadzone, range and invert | ||
| 46 | * properties to the output. | ||
| 47 | * | ||
| 48 | * @param callback Supported callbacks: Stick. | ||
| 49 | * @return A valid StickStatus object. | ||
| 50 | */ | ||
| 51 | Common::Input::StickStatus TransformToStick(const Common::Input::CallbackStatus& callback); | ||
| 52 | |||
| 53 | /** | ||
| 54 | * Converts raw input data into a valid touch status. | ||
| 55 | * | ||
| 56 | * @param callback Supported callbacks: Touch. | ||
| 57 | * @return A valid TouchStatus object. | ||
| 58 | */ | ||
| 59 | Common::Input::TouchStatus TransformToTouch(const Common::Input::CallbackStatus& callback); | ||
| 60 | |||
| 61 | /** | ||
| 62 | * Converts raw input data into a valid trigger status. Applies offset, deadzone, range and | ||
| 63 | * invert properties to the output. Button status uses the threshold property if necessary. | ||
| 64 | * | ||
| 65 | * @param callback Supported callbacks: Analog, Button, Trigger. | ||
| 66 | * @return A valid TriggerStatus object. | ||
| 67 | */ | ||
| 68 | Common::Input::TriggerStatus TransformToTrigger(const Common::Input::CallbackStatus& callback); | ||
| 69 | |||
| 70 | /** | ||
| 71 | * Converts raw input data into a valid analog status. Applies offset, deadzone, range and | ||
| 72 | * invert properties to the output. | ||
| 73 | * | ||
| 74 | * @param callback Supported callbacks: Analog. | ||
| 75 | * @return A valid AnalogStatus object. | ||
| 76 | */ | ||
| 77 | Common::Input::AnalogStatus TransformToAnalog(const Common::Input::CallbackStatus& callback); | ||
| 78 | |||
| 79 | /** | ||
| 80 | * Converts raw input data into a valid camera status. | ||
| 81 | * | ||
| 82 | * @param callback Supported callbacks: Camera. | ||
| 83 | * @return A valid CameraObject object. | ||
| 84 | */ | ||
| 85 | Common::Input::CameraStatus TransformToCamera(const Common::Input::CallbackStatus& callback); | ||
| 86 | |||
| 87 | /** | ||
| 88 | * Converts raw input data into a valid nfc status. | ||
| 89 | * | ||
| 90 | * @param callback Supported callbacks: Nfc. | ||
| 91 | * @return A valid data tag vector. | ||
| 92 | */ | ||
| 93 | Common::Input::NfcStatus TransformToNfc(const Common::Input::CallbackStatus& callback); | ||
| 94 | |||
| 95 | /** | ||
| 96 | * Converts raw input data into a valid color status. | ||
| 97 | * | ||
| 98 | * @param callback Supported callbacks: Color. | ||
| 99 | * @return A valid Color object. | ||
| 100 | */ | ||
| 101 | Common::Input::BodyColorStatus TransformToColor(const Common::Input::CallbackStatus& callback); | ||
| 102 | |||
| 103 | /** | ||
| 104 | * Converts raw analog data into a valid analog value | ||
| 105 | * @param analog An analog object containing raw data and properties | ||
| 106 | * @param clamp_value determines if the value needs to be clamped between -1.0f and 1.0f. | ||
| 107 | */ | ||
| 108 | void SanitizeAnalog(Common::Input::AnalogStatus& analog, bool clamp_value); | ||
| 109 | |||
| 110 | /** | ||
| 111 | * Converts raw stick data into a valid stick value | ||
| 112 | * @param analog_x raw analog data and properties for the x-axis | ||
| 113 | * @param analog_y raw analog data and properties for the y-axis | ||
| 114 | * @param clamp_value bool that determines if the value needs to be clamped into the unit circle. | ||
| 115 | */ | ||
| 116 | void SanitizeStick(Common::Input::AnalogStatus& analog_x, Common::Input::AnalogStatus& analog_y, | ||
| 117 | bool clamp_value); | ||
| 118 | |||
| 119 | } // namespace Core::HID | ||