diff options
| author | 2022-06-18 23:36:29 -0500 | |
|---|---|---|
| committer | 2022-07-23 19:40:25 -0500 | |
| commit | 57311b2c8b1b9ee1d2c5775866e9591605815246 (patch) | |
| tree | 52280f5afc5443a3fddb337cbca71e6e0d4707ab /src/core/hid/input_converter.cpp | |
| parent | yuzu: Hook qt camera to camera driver (diff) | |
| download | yuzu-57311b2c8b1b9ee1d2c5775866e9591605815246.tar.gz yuzu-57311b2c8b1b9ee1d2c5775866e9591605815246.tar.xz yuzu-57311b2c8b1b9ee1d2c5775866e9591605815246.zip | |
core: hid: Add cammera support
Diffstat (limited to 'src/core/hid/input_converter.cpp')
| -rw-r--r-- | src/core/hid/input_converter.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/core/hid/input_converter.cpp b/src/core/hid/input_converter.cpp index 18d9f042d..68d143a01 100644 --- a/src/core/hid/input_converter.cpp +++ b/src/core/hid/input_converter.cpp | |||
| @@ -270,6 +270,20 @@ Common::Input::AnalogStatus TransformToAnalog(const Common::Input::CallbackStatu | |||
| 270 | return status; | 270 | return status; |
| 271 | } | 271 | } |
| 272 | 272 | ||
| 273 | Common::Input::CameraStatus TransformToCamera(const Common::Input::CallbackStatus& callback) { | ||
| 274 | Common::Input::CameraStatus camera{}; | ||
| 275 | switch (callback.type) { | ||
| 276 | case Common::Input::InputType::IrSensor: | ||
| 277 | camera = callback.camera_status; | ||
| 278 | break; | ||
| 279 | default: | ||
| 280 | LOG_ERROR(Input, "Conversion from type {} to camera not implemented", callback.type); | ||
| 281 | break; | ||
| 282 | } | ||
| 283 | |||
| 284 | return camera; | ||
| 285 | } | ||
| 286 | |||
| 273 | void SanitizeAnalog(Common::Input::AnalogStatus& analog, bool clamp_value) { | 287 | void SanitizeAnalog(Common::Input::AnalogStatus& analog, bool clamp_value) { |
| 274 | const auto& properties = analog.properties; | 288 | const auto& properties = analog.properties; |
| 275 | float& raw_value = analog.raw_value; | 289 | float& raw_value = analog.raw_value; |