diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hid/emulated_controller.cpp | 46 | ||||
| -rw-r--r-- | src/core/hid/emulated_controller.h | 35 | ||||
| -rw-r--r-- | src/core/hid/emulated_devices.cpp | 46 | ||||
| -rw-r--r-- | src/core/hid/emulated_devices.h | 18 | ||||
| -rw-r--r-- | src/core/hle/service/hid/hidbus/ringcon.cpp | 6 | ||||
| -rw-r--r-- | src/core/hle/service/hid/hidbus/ringcon.h | 4 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_ringcon.cpp | 34 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_ringcon.h | 4 |
8 files changed, 105 insertions, 88 deletions
diff --git a/src/core/hid/emulated_controller.cpp b/src/core/hid/emulated_controller.cpp index 7a01f3f4c..128101e8c 100644 --- a/src/core/hid/emulated_controller.cpp +++ b/src/core/hid/emulated_controller.cpp | |||
| @@ -139,6 +139,7 @@ void EmulatedController::LoadDevices() { | |||
| 139 | 139 | ||
| 140 | camera_params = Common::ParamPackage{"engine:camera,camera:1"}; | 140 | camera_params = Common::ParamPackage{"engine:camera,camera:1"}; |
| 141 | nfc_params = Common::ParamPackage{"engine:virtual_amiibo,nfc:1"}; | 141 | nfc_params = Common::ParamPackage{"engine:virtual_amiibo,nfc:1"}; |
| 142 | ring_params = Common::ParamPackage{"engine:joycon,axis_x:100,axis_y:101"}; | ||
| 142 | 143 | ||
| 143 | output_params[LeftIndex] = left_joycon; | 144 | output_params[LeftIndex] = left_joycon; |
| 144 | output_params[RightIndex] = right_joycon; | 145 | output_params[RightIndex] = right_joycon; |
| @@ -160,6 +161,7 @@ void EmulatedController::LoadDevices() { | |||
| 160 | std::ranges::transform(battery_params, battery_devices.begin(), | 161 | std::ranges::transform(battery_params, battery_devices.begin(), |
| 161 | Common::Input::CreateInputDevice); | 162 | Common::Input::CreateInputDevice); |
| 162 | camera_devices = Common::Input::CreateInputDevice(camera_params); | 163 | camera_devices = Common::Input::CreateInputDevice(camera_params); |
| 164 | ring_analog_device = Common::Input::CreateInputDevice(ring_params); | ||
| 163 | nfc_devices = Common::Input::CreateInputDevice(nfc_params); | 165 | nfc_devices = Common::Input::CreateInputDevice(nfc_params); |
| 164 | std::ranges::transform(output_params, output_devices.begin(), | 166 | std::ranges::transform(output_params, output_devices.begin(), |
| 165 | Common::Input::CreateOutputDevice); | 167 | Common::Input::CreateOutputDevice); |
| @@ -343,6 +345,13 @@ void EmulatedController::ReloadInput() { | |||
| 343 | camera_devices->ForceUpdate(); | 345 | camera_devices->ForceUpdate(); |
| 344 | } | 346 | } |
| 345 | 347 | ||
| 348 | if (ring_analog_device) { | ||
| 349 | ring_analog_device->SetCallback({ | ||
| 350 | .on_change = | ||
| 351 | [this](const Common::Input::CallbackStatus& callback) { SetRingAnalog(callback); }, | ||
| 352 | }); | ||
| 353 | } | ||
| 354 | |||
| 346 | if (nfc_devices) { | 355 | if (nfc_devices) { |
| 347 | if (npad_id_type == NpadIdType::Handheld || npad_id_type == NpadIdType::Player1) { | 356 | if (npad_id_type == NpadIdType::Handheld || npad_id_type == NpadIdType::Player1) { |
| 348 | nfc_devices->SetCallback({ | 357 | nfc_devices->SetCallback({ |
| @@ -436,6 +445,7 @@ void EmulatedController::UnloadInput() { | |||
| 436 | stick.reset(); | 445 | stick.reset(); |
| 437 | } | 446 | } |
| 438 | camera_devices.reset(); | 447 | camera_devices.reset(); |
| 448 | ring_analog_device.reset(); | ||
| 439 | nfc_devices.reset(); | 449 | nfc_devices.reset(); |
| 440 | } | 450 | } |
| 441 | 451 | ||
| @@ -501,6 +511,7 @@ void EmulatedController::SaveCurrentConfig() { | |||
| 501 | for (std::size_t index = 0; index < player.motions.size(); ++index) { | 511 | for (std::size_t index = 0; index < player.motions.size(); ++index) { |
| 502 | player.motions[index] = motion_params[index].Serialize(); | 512 | player.motions[index] = motion_params[index].Serialize(); |
| 503 | } | 513 | } |
| 514 | Settings::values.ringcon_analogs = ring_params.Serialize(); | ||
| 504 | } | 515 | } |
| 505 | 516 | ||
| 506 | void EmulatedController::RestoreConfig() { | 517 | void EmulatedController::RestoreConfig() { |
| @@ -1005,6 +1016,24 @@ void EmulatedController::SetCamera(const Common::Input::CallbackStatus& callback | |||
| 1005 | TriggerOnChange(ControllerTriggerType::IrSensor, true); | 1016 | TriggerOnChange(ControllerTriggerType::IrSensor, true); |
| 1006 | } | 1017 | } |
| 1007 | 1018 | ||
| 1019 | void EmulatedController::SetRingAnalog(const Common::Input::CallbackStatus& callback) { | ||
| 1020 | std::unique_lock lock{mutex}; | ||
| 1021 | const auto force_value = TransformToStick(callback); | ||
| 1022 | |||
| 1023 | controller.ring_analog_value = force_value.x; | ||
| 1024 | |||
| 1025 | if (is_configuring) { | ||
| 1026 | lock.unlock(); | ||
| 1027 | TriggerOnChange(ControllerTriggerType::RingController, false); | ||
| 1028 | return; | ||
| 1029 | } | ||
| 1030 | |||
| 1031 | controller.ring_analog_state.force = force_value.x.value; | ||
| 1032 | |||
| 1033 | lock.unlock(); | ||
| 1034 | TriggerOnChange(ControllerTriggerType::RingController, true); | ||
| 1035 | } | ||
| 1036 | |||
| 1008 | void EmulatedController::SetNfc(const Common::Input::CallbackStatus& callback) { | 1037 | void EmulatedController::SetNfc(const Common::Input::CallbackStatus& callback) { |
| 1009 | std::unique_lock lock{mutex}; | 1038 | std::unique_lock lock{mutex}; |
| 1010 | controller.nfc_values = TransformToNfc(callback); | 1039 | controller.nfc_values = TransformToNfc(callback); |
| @@ -1104,6 +1133,15 @@ bool EmulatedController::SetCameraFormat( | |||
| 1104 | camera_format)) == Common::Input::CameraError::None; | 1133 | camera_format)) == Common::Input::CameraError::None; |
| 1105 | } | 1134 | } |
| 1106 | 1135 | ||
| 1136 | Common::ParamPackage EmulatedController::GetRingParam() const { | ||
| 1137 | return ring_params; | ||
| 1138 | } | ||
| 1139 | |||
| 1140 | void EmulatedController::SetRingParam(Common::ParamPackage param) { | ||
| 1141 | ring_params = std::move(param); | ||
| 1142 | ReloadInput(); | ||
| 1143 | } | ||
| 1144 | |||
| 1107 | bool EmulatedController::HasNfc() const { | 1145 | bool EmulatedController::HasNfc() const { |
| 1108 | const auto& nfc_output_device = output_devices[3]; | 1146 | const auto& nfc_output_device = output_devices[3]; |
| 1109 | 1147 | ||
| @@ -1395,6 +1433,10 @@ CameraValues EmulatedController::GetCameraValues() const { | |||
| 1395 | return controller.camera_values; | 1433 | return controller.camera_values; |
| 1396 | } | 1434 | } |
| 1397 | 1435 | ||
| 1436 | RingAnalogValue EmulatedController::GetRingSensorValues() const { | ||
| 1437 | return controller.ring_analog_value; | ||
| 1438 | } | ||
| 1439 | |||
| 1398 | HomeButtonState EmulatedController::GetHomeButtons() const { | 1440 | HomeButtonState EmulatedController::GetHomeButtons() const { |
| 1399 | std::scoped_lock lock{mutex}; | 1441 | std::scoped_lock lock{mutex}; |
| 1400 | if (is_configuring) { | 1442 | if (is_configuring) { |
| @@ -1478,6 +1520,10 @@ const CameraState& EmulatedController::GetCamera() const { | |||
| 1478 | return controller.camera_state; | 1520 | return controller.camera_state; |
| 1479 | } | 1521 | } |
| 1480 | 1522 | ||
| 1523 | RingSensorForce EmulatedController::GetRingSensorForce() const { | ||
| 1524 | return controller.ring_analog_state; | ||
| 1525 | } | ||
| 1526 | |||
| 1481 | const NfcState& EmulatedController::GetNfc() const { | 1527 | const NfcState& EmulatedController::GetNfc() const { |
| 1482 | std::scoped_lock lock{mutex}; | 1528 | std::scoped_lock lock{mutex}; |
| 1483 | return controller.nfc_state; | 1529 | return controller.nfc_state; |
diff --git a/src/core/hid/emulated_controller.h b/src/core/hid/emulated_controller.h index a398543a6..aed331a1a 100644 --- a/src/core/hid/emulated_controller.h +++ b/src/core/hid/emulated_controller.h | |||
| @@ -38,6 +38,7 @@ using TriggerDevices = | |||
| 38 | using BatteryDevices = | 38 | using BatteryDevices = |
| 39 | std::array<std::unique_ptr<Common::Input::InputDevice>, max_emulated_controllers>; | 39 | std::array<std::unique_ptr<Common::Input::InputDevice>, max_emulated_controllers>; |
| 40 | using CameraDevices = std::unique_ptr<Common::Input::InputDevice>; | 40 | using CameraDevices = std::unique_ptr<Common::Input::InputDevice>; |
| 41 | using RingAnalogDevice = std::unique_ptr<Common::Input::InputDevice>; | ||
| 41 | using NfcDevices = std::unique_ptr<Common::Input::InputDevice>; | 42 | using NfcDevices = std::unique_ptr<Common::Input::InputDevice>; |
| 42 | using OutputDevices = std::array<std::unique_ptr<Common::Input::OutputDevice>, output_devices_size>; | 43 | using OutputDevices = std::array<std::unique_ptr<Common::Input::OutputDevice>, output_devices_size>; |
| 43 | 44 | ||
| @@ -47,6 +48,7 @@ using ControllerMotionParams = std::array<Common::ParamPackage, Settings::Native | |||
| 47 | using TriggerParams = std::array<Common::ParamPackage, Settings::NativeTrigger::NumTriggers>; | 48 | using TriggerParams = std::array<Common::ParamPackage, Settings::NativeTrigger::NumTriggers>; |
| 48 | using BatteryParams = std::array<Common::ParamPackage, max_emulated_controllers>; | 49 | using BatteryParams = std::array<Common::ParamPackage, max_emulated_controllers>; |
| 49 | using CameraParams = Common::ParamPackage; | 50 | using CameraParams = Common::ParamPackage; |
| 51 | using RingAnalogParams = Common::ParamPackage; | ||
| 50 | using NfcParams = Common::ParamPackage; | 52 | using NfcParams = Common::ParamPackage; |
| 51 | using OutputParams = std::array<Common::ParamPackage, output_devices_size>; | 53 | using OutputParams = std::array<Common::ParamPackage, output_devices_size>; |
| 52 | 54 | ||
| @@ -58,6 +60,7 @@ using ControllerMotionValues = std::array<ControllerMotionInfo, Settings::Native | |||
| 58 | using ColorValues = std::array<Common::Input::BodyColorStatus, max_emulated_controllers>; | 60 | using ColorValues = std::array<Common::Input::BodyColorStatus, max_emulated_controllers>; |
| 59 | using BatteryValues = std::array<Common::Input::BatteryStatus, max_emulated_controllers>; | 61 | using BatteryValues = std::array<Common::Input::BatteryStatus, max_emulated_controllers>; |
| 60 | using CameraValues = Common::Input::CameraStatus; | 62 | using CameraValues = Common::Input::CameraStatus; |
| 63 | using RingAnalogValue = Common::Input::AnalogStatus; | ||
| 61 | using NfcValues = Common::Input::NfcStatus; | 64 | using NfcValues = Common::Input::NfcStatus; |
| 62 | using VibrationValues = std::array<Common::Input::VibrationStatus, max_emulated_controllers>; | 65 | using VibrationValues = std::array<Common::Input::VibrationStatus, max_emulated_controllers>; |
| 63 | 66 | ||
| @@ -84,6 +87,10 @@ struct CameraState { | |||
| 84 | std::size_t sample{}; | 87 | std::size_t sample{}; |
| 85 | }; | 88 | }; |
| 86 | 89 | ||
| 90 | struct RingSensorForce { | ||
| 91 | f32 force; | ||
| 92 | }; | ||
| 93 | |||
| 87 | struct NfcState { | 94 | struct NfcState { |
| 88 | Common::Input::NfcState state{}; | 95 | Common::Input::NfcState state{}; |
| 89 | std::vector<u8> data{}; | 96 | std::vector<u8> data{}; |
| @@ -116,6 +123,7 @@ struct ControllerStatus { | |||
| 116 | BatteryValues battery_values{}; | 123 | BatteryValues battery_values{}; |
| 117 | VibrationValues vibration_values{}; | 124 | VibrationValues vibration_values{}; |
| 118 | CameraValues camera_values{}; | 125 | CameraValues camera_values{}; |
| 126 | RingAnalogValue ring_analog_value{}; | ||
| 119 | NfcValues nfc_values{}; | 127 | NfcValues nfc_values{}; |
| 120 | 128 | ||
| 121 | // Data for HID serices | 129 | // Data for HID serices |
| @@ -129,6 +137,7 @@ struct ControllerStatus { | |||
| 129 | ControllerColors colors_state{}; | 137 | ControllerColors colors_state{}; |
| 130 | BatteryLevelState battery_state{}; | 138 | BatteryLevelState battery_state{}; |
| 131 | CameraState camera_state{}; | 139 | CameraState camera_state{}; |
| 140 | RingSensorForce ring_analog_state{}; | ||
| 132 | NfcState nfc_state{}; | 141 | NfcState nfc_state{}; |
| 133 | }; | 142 | }; |
| 134 | 143 | ||
| @@ -141,6 +150,7 @@ enum class ControllerTriggerType { | |||
| 141 | Battery, | 150 | Battery, |
| 142 | Vibration, | 151 | Vibration, |
| 143 | IrSensor, | 152 | IrSensor, |
| 153 | RingController, | ||
| 144 | Nfc, | 154 | Nfc, |
| 145 | Connected, | 155 | Connected, |
| 146 | Disconnected, | 156 | Disconnected, |
| @@ -294,6 +304,9 @@ public: | |||
| 294 | /// Returns the latest camera status from the controller with parameters | 304 | /// Returns the latest camera status from the controller with parameters |
| 295 | CameraValues GetCameraValues() const; | 305 | CameraValues GetCameraValues() const; |
| 296 | 306 | ||
| 307 | /// Returns the latest status of analog input from the ring sensor with parameters | ||
| 308 | RingAnalogValue GetRingSensorValues() const; | ||
| 309 | |||
| 297 | /// Returns the latest status of button input for the hid::HomeButton service | 310 | /// Returns the latest status of button input for the hid::HomeButton service |
| 298 | HomeButtonState GetHomeButtons() const; | 311 | HomeButtonState GetHomeButtons() const; |
| 299 | 312 | ||
| @@ -324,6 +337,9 @@ public: | |||
| 324 | /// Returns the latest camera status from the controller | 337 | /// Returns the latest camera status from the controller |
| 325 | const CameraState& GetCamera() const; | 338 | const CameraState& GetCamera() const; |
| 326 | 339 | ||
| 340 | /// Returns the latest ringcon force sensor value | ||
| 341 | RingSensorForce GetRingSensorForce() const; | ||
| 342 | |||
| 327 | /// Returns the latest ntag status from the controller | 343 | /// Returns the latest ntag status from the controller |
| 328 | const NfcState& GetNfc() const; | 344 | const NfcState& GetNfc() const; |
| 329 | 345 | ||
| @@ -353,6 +369,15 @@ public: | |||
| 353 | */ | 369 | */ |
| 354 | bool SetCameraFormat(Core::IrSensor::ImageTransferProcessorFormat camera_format); | 370 | bool SetCameraFormat(Core::IrSensor::ImageTransferProcessorFormat camera_format); |
| 355 | 371 | ||
| 372 | // Returns the current mapped ring device | ||
| 373 | Common::ParamPackage GetRingParam() const; | ||
| 374 | |||
| 375 | /** | ||
| 376 | * Updates the current mapped ring device | ||
| 377 | * @param param ParamPackage with ring sensor data to be mapped | ||
| 378 | */ | ||
| 379 | void SetRingParam(Common::ParamPackage param); | ||
| 380 | |||
| 356 | /// Returns true if the device has nfc support | 381 | /// Returns true if the device has nfc support |
| 357 | bool HasNfc() const; | 382 | bool HasNfc() const; |
| 358 | 383 | ||
| @@ -435,7 +460,7 @@ private: | |||
| 435 | /** | 460 | /** |
| 436 | * Updates the battery status of the controller | 461 | * Updates the battery status of the controller |
| 437 | * @param callback A CallbackStatus containing the battery status | 462 | * @param callback A CallbackStatus containing the battery status |
| 438 | * @param index Button ID of the to be updated | 463 | * @param index battery ID of the to be updated |
| 439 | */ | 464 | */ |
| 440 | void SetBattery(const Common::Input::CallbackStatus& callback, std::size_t index); | 465 | void SetBattery(const Common::Input::CallbackStatus& callback, std::size_t index); |
| 441 | 466 | ||
| @@ -446,6 +471,12 @@ private: | |||
| 446 | void SetCamera(const Common::Input::CallbackStatus& callback); | 471 | void SetCamera(const Common::Input::CallbackStatus& callback); |
| 447 | 472 | ||
| 448 | /** | 473 | /** |
| 474 | * Updates the ring analog sensor status of the ring controller | ||
| 475 | * @param callback A CallbackStatus containing the force status | ||
| 476 | */ | ||
| 477 | void SetRingAnalog(const Common::Input::CallbackStatus& callback); | ||
| 478 | |||
| 479 | /** | ||
| 449 | * Updates the nfc status of the controller | 480 | * Updates the nfc status of the controller |
| 450 | * @param callback A CallbackStatus containing the nfc status | 481 | * @param callback A CallbackStatus containing the nfc status |
| 451 | */ | 482 | */ |
| @@ -485,6 +516,7 @@ private: | |||
| 485 | TriggerParams trigger_params; | 516 | TriggerParams trigger_params; |
| 486 | BatteryParams battery_params; | 517 | BatteryParams battery_params; |
| 487 | CameraParams camera_params; | 518 | CameraParams camera_params; |
| 519 | RingAnalogParams ring_params; | ||
| 488 | NfcParams nfc_params; | 520 | NfcParams nfc_params; |
| 489 | OutputParams output_params; | 521 | OutputParams output_params; |
| 490 | 522 | ||
| @@ -494,6 +526,7 @@ private: | |||
| 494 | TriggerDevices trigger_devices; | 526 | TriggerDevices trigger_devices; |
| 495 | BatteryDevices battery_devices; | 527 | BatteryDevices battery_devices; |
| 496 | CameraDevices camera_devices; | 528 | CameraDevices camera_devices; |
| 529 | RingAnalogDevice ring_analog_device; | ||
| 497 | NfcDevices nfc_devices; | 530 | NfcDevices nfc_devices; |
| 498 | OutputDevices output_devices; | 531 | OutputDevices output_devices; |
| 499 | 532 | ||
diff --git a/src/core/hid/emulated_devices.cpp b/src/core/hid/emulated_devices.cpp index e421828d2..836f32c0f 100644 --- a/src/core/hid/emulated_devices.cpp +++ b/src/core/hid/emulated_devices.cpp | |||
| @@ -14,7 +14,6 @@ EmulatedDevices::EmulatedDevices() = default; | |||
| 14 | EmulatedDevices::~EmulatedDevices() = default; | 14 | EmulatedDevices::~EmulatedDevices() = default; |
| 15 | 15 | ||
| 16 | void EmulatedDevices::ReloadFromSettings() { | 16 | void EmulatedDevices::ReloadFromSettings() { |
| 17 | ring_params = Common::ParamPackage(Settings::values.ringcon_analogs); | ||
| 18 | ReloadInput(); | 17 | ReloadInput(); |
| 19 | } | 18 | } |
| 20 | 19 | ||
| @@ -66,8 +65,6 @@ void EmulatedDevices::ReloadInput() { | |||
| 66 | key_index++; | 65 | key_index++; |
| 67 | } | 66 | } |
| 68 | 67 | ||
| 69 | ring_analog_device = Common::Input::CreateInputDevice(ring_params); | ||
| 70 | |||
| 71 | for (std::size_t index = 0; index < mouse_button_devices.size(); ++index) { | 68 | for (std::size_t index = 0; index < mouse_button_devices.size(); ++index) { |
| 72 | if (!mouse_button_devices[index]) { | 69 | if (!mouse_button_devices[index]) { |
| 73 | continue; | 70 | continue; |
| @@ -122,13 +119,6 @@ void EmulatedDevices::ReloadInput() { | |||
| 122 | }, | 119 | }, |
| 123 | }); | 120 | }); |
| 124 | } | 121 | } |
| 125 | |||
| 126 | if (ring_analog_device) { | ||
| 127 | ring_analog_device->SetCallback({ | ||
| 128 | .on_change = | ||
| 129 | [this](const Common::Input::CallbackStatus& callback) { SetRingAnalog(callback); }, | ||
| 130 | }); | ||
| 131 | } | ||
| 132 | } | 122 | } |
| 133 | 123 | ||
| 134 | void EmulatedDevices::UnloadInput() { | 124 | void EmulatedDevices::UnloadInput() { |
| @@ -145,7 +135,6 @@ void EmulatedDevices::UnloadInput() { | |||
| 145 | for (auto& button : keyboard_modifier_devices) { | 135 | for (auto& button : keyboard_modifier_devices) { |
| 146 | button.reset(); | 136 | button.reset(); |
| 147 | } | 137 | } |
| 148 | ring_analog_device.reset(); | ||
| 149 | } | 138 | } |
| 150 | 139 | ||
| 151 | void EmulatedDevices::EnableConfiguration() { | 140 | void EmulatedDevices::EnableConfiguration() { |
| @@ -165,7 +154,6 @@ void EmulatedDevices::SaveCurrentConfig() { | |||
| 165 | if (!is_configuring) { | 154 | if (!is_configuring) { |
| 166 | return; | 155 | return; |
| 167 | } | 156 | } |
| 168 | Settings::values.ringcon_analogs = ring_params.Serialize(); | ||
| 169 | } | 157 | } |
| 170 | 158 | ||
| 171 | void EmulatedDevices::RestoreConfig() { | 159 | void EmulatedDevices::RestoreConfig() { |
| @@ -175,15 +163,6 @@ void EmulatedDevices::RestoreConfig() { | |||
| 175 | ReloadFromSettings(); | 163 | ReloadFromSettings(); |
| 176 | } | 164 | } |
| 177 | 165 | ||
| 178 | Common::ParamPackage EmulatedDevices::GetRingParam() const { | ||
| 179 | return ring_params; | ||
| 180 | } | ||
| 181 | |||
| 182 | void EmulatedDevices::SetRingParam(Common::ParamPackage param) { | ||
| 183 | ring_params = std::move(param); | ||
| 184 | ReloadInput(); | ||
| 185 | } | ||
| 186 | |||
| 187 | void EmulatedDevices::SetKeyboardButton(const Common::Input::CallbackStatus& callback, | 166 | void EmulatedDevices::SetKeyboardButton(const Common::Input::CallbackStatus& callback, |
| 188 | std::size_t index) { | 167 | std::size_t index) { |
| 189 | if (index >= device_status.keyboard_values.size()) { | 168 | if (index >= device_status.keyboard_values.size()) { |
| @@ -430,23 +409,6 @@ void EmulatedDevices::SetMouseStick(const Common::Input::CallbackStatus& callbac | |||
| 430 | TriggerOnChange(DeviceTriggerType::Mouse); | 409 | TriggerOnChange(DeviceTriggerType::Mouse); |
| 431 | } | 410 | } |
| 432 | 411 | ||
| 433 | void EmulatedDevices::SetRingAnalog(const Common::Input::CallbackStatus& callback) { | ||
| 434 | std::lock_guard lock{mutex}; | ||
| 435 | const auto force_value = TransformToStick(callback); | ||
| 436 | |||
| 437 | device_status.ring_analog_value = force_value.x; | ||
| 438 | |||
| 439 | if (is_configuring) { | ||
| 440 | device_status.ring_analog_value = {}; | ||
| 441 | TriggerOnChange(DeviceTriggerType::RingController); | ||
| 442 | return; | ||
| 443 | } | ||
| 444 | |||
| 445 | device_status.ring_analog_state.force = force_value.x.value; | ||
| 446 | |||
| 447 | TriggerOnChange(DeviceTriggerType::RingController); | ||
| 448 | } | ||
| 449 | |||
| 450 | KeyboardValues EmulatedDevices::GetKeyboardValues() const { | 412 | KeyboardValues EmulatedDevices::GetKeyboardValues() const { |
| 451 | std::scoped_lock lock{mutex}; | 413 | std::scoped_lock lock{mutex}; |
| 452 | return device_status.keyboard_values; | 414 | return device_status.keyboard_values; |
| @@ -462,10 +424,6 @@ MouseButtonValues EmulatedDevices::GetMouseButtonsValues() const { | |||
| 462 | return device_status.mouse_button_values; | 424 | return device_status.mouse_button_values; |
| 463 | } | 425 | } |
| 464 | 426 | ||
| 465 | RingAnalogValue EmulatedDevices::GetRingSensorValues() const { | ||
| 466 | return device_status.ring_analog_value; | ||
| 467 | } | ||
| 468 | |||
| 469 | KeyboardKey EmulatedDevices::GetKeyboard() const { | 427 | KeyboardKey EmulatedDevices::GetKeyboard() const { |
| 470 | std::scoped_lock lock{mutex}; | 428 | std::scoped_lock lock{mutex}; |
| 471 | return device_status.keyboard_state; | 429 | return device_status.keyboard_state; |
| @@ -491,10 +449,6 @@ AnalogStickState EmulatedDevices::GetMouseWheel() const { | |||
| 491 | return device_status.mouse_wheel_state; | 449 | return device_status.mouse_wheel_state; |
| 492 | } | 450 | } |
| 493 | 451 | ||
| 494 | RingSensorForce EmulatedDevices::GetRingSensorForce() const { | ||
| 495 | return device_status.ring_analog_state; | ||
| 496 | } | ||
| 497 | |||
| 498 | void EmulatedDevices::TriggerOnChange(DeviceTriggerType type) { | 452 | void EmulatedDevices::TriggerOnChange(DeviceTriggerType type) { |
| 499 | std::scoped_lock lock{callback_mutex}; | 453 | std::scoped_lock lock{callback_mutex}; |
| 500 | for (const auto& poller_pair : callback_list) { | 454 | for (const auto& poller_pair : callback_list) { |
diff --git a/src/core/hid/emulated_devices.h b/src/core/hid/emulated_devices.h index 4cdbf9dc6..76f9150df 100644 --- a/src/core/hid/emulated_devices.h +++ b/src/core/hid/emulated_devices.h | |||
| @@ -26,11 +26,9 @@ using MouseButtonDevices = std::array<std::unique_ptr<Common::Input::InputDevice | |||
| 26 | using MouseAnalogDevices = std::array<std::unique_ptr<Common::Input::InputDevice>, | 26 | using MouseAnalogDevices = std::array<std::unique_ptr<Common::Input::InputDevice>, |
| 27 | Settings::NativeMouseWheel::NumMouseWheels>; | 27 | Settings::NativeMouseWheel::NumMouseWheels>; |
| 28 | using MouseStickDevice = std::unique_ptr<Common::Input::InputDevice>; | 28 | using MouseStickDevice = std::unique_ptr<Common::Input::InputDevice>; |
| 29 | using RingAnalogDevice = std::unique_ptr<Common::Input::InputDevice>; | ||
| 30 | 29 | ||
| 31 | using MouseButtonParams = | 30 | using MouseButtonParams = |
| 32 | std::array<Common::ParamPackage, Settings::NativeMouseButton::NumMouseButtons>; | 31 | std::array<Common::ParamPackage, Settings::NativeMouseButton::NumMouseButtons>; |
| 33 | using RingAnalogParams = Common::ParamPackage; | ||
| 34 | 32 | ||
| 35 | using KeyboardValues = | 33 | using KeyboardValues = |
| 36 | std::array<Common::Input::ButtonStatus, Settings::NativeKeyboard::NumKeyboardKeys>; | 34 | std::array<Common::Input::ButtonStatus, Settings::NativeKeyboard::NumKeyboardKeys>; |
| @@ -41,17 +39,12 @@ using MouseButtonValues = | |||
| 41 | using MouseAnalogValues = | 39 | using MouseAnalogValues = |
| 42 | std::array<Common::Input::AnalogStatus, Settings::NativeMouseWheel::NumMouseWheels>; | 40 | std::array<Common::Input::AnalogStatus, Settings::NativeMouseWheel::NumMouseWheels>; |
| 43 | using MouseStickValue = Common::Input::TouchStatus; | 41 | using MouseStickValue = Common::Input::TouchStatus; |
| 44 | using RingAnalogValue = Common::Input::AnalogStatus; | ||
| 45 | 42 | ||
| 46 | struct MousePosition { | 43 | struct MousePosition { |
| 47 | f32 x; | 44 | f32 x; |
| 48 | f32 y; | 45 | f32 y; |
| 49 | }; | 46 | }; |
| 50 | 47 | ||
| 51 | struct RingSensorForce { | ||
| 52 | f32 force; | ||
| 53 | }; | ||
| 54 | |||
| 55 | struct DeviceStatus { | 48 | struct DeviceStatus { |
| 56 | // Data from input_common | 49 | // Data from input_common |
| 57 | KeyboardValues keyboard_values{}; | 50 | KeyboardValues keyboard_values{}; |
| @@ -59,7 +52,6 @@ struct DeviceStatus { | |||
| 59 | MouseButtonValues mouse_button_values{}; | 52 | MouseButtonValues mouse_button_values{}; |
| 60 | MouseAnalogValues mouse_analog_values{}; | 53 | MouseAnalogValues mouse_analog_values{}; |
| 61 | MouseStickValue mouse_stick_value{}; | 54 | MouseStickValue mouse_stick_value{}; |
| 62 | RingAnalogValue ring_analog_value{}; | ||
| 63 | 55 | ||
| 64 | // Data for HID serices | 56 | // Data for HID serices |
| 65 | KeyboardKey keyboard_state{}; | 57 | KeyboardKey keyboard_state{}; |
| @@ -67,7 +59,6 @@ struct DeviceStatus { | |||
| 67 | MouseButton mouse_button_state{}; | 59 | MouseButton mouse_button_state{}; |
| 68 | MousePosition mouse_position_state{}; | 60 | MousePosition mouse_position_state{}; |
| 69 | AnalogStickState mouse_wheel_state{}; | 61 | AnalogStickState mouse_wheel_state{}; |
| 70 | RingSensorForce ring_analog_state{}; | ||
| 71 | }; | 62 | }; |
| 72 | 63 | ||
| 73 | enum class DeviceTriggerType { | 64 | enum class DeviceTriggerType { |
| @@ -138,9 +129,6 @@ public: | |||
| 138 | /// Returns the latest status of button input from the mouse with parameters | 129 | /// Returns the latest status of button input from the mouse with parameters |
| 139 | MouseButtonValues GetMouseButtonsValues() const; | 130 | MouseButtonValues GetMouseButtonsValues() const; |
| 140 | 131 | ||
| 141 | /// Returns the latest status of analog input from the ring sensor with parameters | ||
| 142 | RingAnalogValue GetRingSensorValues() const; | ||
| 143 | |||
| 144 | /// Returns the latest status of button input from the keyboard | 132 | /// Returns the latest status of button input from the keyboard |
| 145 | KeyboardKey GetKeyboard() const; | 133 | KeyboardKey GetKeyboard() const; |
| 146 | 134 | ||
| @@ -156,9 +144,6 @@ public: | |||
| 156 | /// Returns the latest mouse wheel change | 144 | /// Returns the latest mouse wheel change |
| 157 | AnalogStickState GetMouseWheel() const; | 145 | AnalogStickState GetMouseWheel() const; |
| 158 | 146 | ||
| 159 | /// Returns the latest ringcon force sensor value | ||
| 160 | RingSensorForce GetRingSensorForce() const; | ||
| 161 | |||
| 162 | /** | 147 | /** |
| 163 | * Adds a callback to the list of events | 148 | * Adds a callback to the list of events |
| 164 | * @param update_callback InterfaceUpdateCallback that will be triggered | 149 | * @param update_callback InterfaceUpdateCallback that will be triggered |
| @@ -224,14 +209,11 @@ private: | |||
| 224 | 209 | ||
| 225 | bool is_configuring{false}; | 210 | bool is_configuring{false}; |
| 226 | 211 | ||
| 227 | RingAnalogParams ring_params; | ||
| 228 | |||
| 229 | KeyboardDevices keyboard_devices; | 212 | KeyboardDevices keyboard_devices; |
| 230 | KeyboardModifierDevices keyboard_modifier_devices; | 213 | KeyboardModifierDevices keyboard_modifier_devices; |
| 231 | MouseButtonDevices mouse_button_devices; | 214 | MouseButtonDevices mouse_button_devices; |
| 232 | MouseAnalogDevices mouse_analog_devices; | 215 | MouseAnalogDevices mouse_analog_devices; |
| 233 | MouseStickDevice mouse_stick_device; | 216 | MouseStickDevice mouse_stick_device; |
| 234 | RingAnalogDevice ring_analog_device; | ||
| 235 | 217 | ||
| 236 | mutable std::mutex mutex; | 218 | mutable std::mutex mutex; |
| 237 | mutable std::mutex callback_mutex; | 219 | mutable std::mutex callback_mutex; |
diff --git a/src/core/hle/service/hid/hidbus/ringcon.cpp b/src/core/hle/service/hid/hidbus/ringcon.cpp index 57f1a2a26..af776d506 100644 --- a/src/core/hle/service/hid/hidbus/ringcon.cpp +++ b/src/core/hle/service/hid/hidbus/ringcon.cpp | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project | 1 | // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #include "core/hid/emulated_devices.h" | 4 | #include "core/hid/emulated_controller.h" |
| 5 | #include "core/hid/hid_core.h" | 5 | #include "core/hid/hid_core.h" |
| 6 | #include "core/hle/kernel/k_event.h" | 6 | #include "core/hle/kernel/k_event.h" |
| 7 | #include "core/hle/kernel/k_readable_event.h" | 7 | #include "core/hle/kernel/k_readable_event.h" |
| @@ -12,16 +12,18 @@ namespace Service::HID { | |||
| 12 | RingController::RingController(Core::HID::HIDCore& hid_core_, | 12 | RingController::RingController(Core::HID::HIDCore& hid_core_, |
| 13 | KernelHelpers::ServiceContext& service_context_) | 13 | KernelHelpers::ServiceContext& service_context_) |
| 14 | : HidbusBase(service_context_) { | 14 | : HidbusBase(service_context_) { |
| 15 | input = hid_core_.GetEmulatedDevices(); | 15 | input = hid_core_.GetEmulatedController(Core::HID::NpadIdType::Player1); |
| 16 | } | 16 | } |
| 17 | 17 | ||
| 18 | RingController::~RingController() = default; | 18 | RingController::~RingController() = default; |
| 19 | 19 | ||
| 20 | void RingController::OnInit() { | 20 | void RingController::OnInit() { |
| 21 | input->SetPollingMode(Common::Input::PollingMode::Ring); | ||
| 21 | return; | 22 | return; |
| 22 | } | 23 | } |
| 23 | 24 | ||
| 24 | void RingController::OnRelease() { | 25 | void RingController::OnRelease() { |
| 26 | input->SetPollingMode(Common::Input::PollingMode::Active); | ||
| 25 | return; | 27 | return; |
| 26 | }; | 28 | }; |
| 27 | 29 | ||
diff --git a/src/core/hle/service/hid/hidbus/ringcon.h b/src/core/hle/service/hid/hidbus/ringcon.h index b37df50ac..845ce85a5 100644 --- a/src/core/hle/service/hid/hidbus/ringcon.h +++ b/src/core/hle/service/hid/hidbus/ringcon.h | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | #include "core/hle/service/hid/hidbus/hidbus_base.h" | 9 | #include "core/hle/service/hid/hidbus/hidbus_base.h" |
| 10 | 10 | ||
| 11 | namespace Core::HID { | 11 | namespace Core::HID { |
| 12 | class EmulatedDevices; | 12 | class EmulatedController; |
| 13 | } // namespace Core::HID | 13 | } // namespace Core::HID |
| 14 | 14 | ||
| 15 | namespace Service::HID { | 15 | namespace Service::HID { |
| @@ -248,6 +248,6 @@ private: | |||
| 248 | .zero = {.value = idle_value, .crc = 225}, | 248 | .zero = {.value = idle_value, .crc = 225}, |
| 249 | }; | 249 | }; |
| 250 | 250 | ||
| 251 | Core::HID::EmulatedDevices* input; | 251 | Core::HID::EmulatedController* input; |
| 252 | }; | 252 | }; |
| 253 | } // namespace Service::HID | 253 | } // namespace Service::HID |
diff --git a/src/yuzu/configuration/configure_ringcon.cpp b/src/yuzu/configuration/configure_ringcon.cpp index 688c2dd38..0cfe3b60e 100644 --- a/src/yuzu/configuration/configure_ringcon.cpp +++ b/src/yuzu/configuration/configure_ringcon.cpp | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | #include <QMenu> | 6 | #include <QMenu> |
| 7 | #include <QTimer> | 7 | #include <QTimer> |
| 8 | 8 | ||
| 9 | #include "core/hid/emulated_devices.h" | 9 | #include "core/hid/emulated_controller.h" |
| 10 | #include "core/hid/hid_core.h" | 10 | #include "core/hid/hid_core.h" |
| 11 | #include "input_common/drivers/keyboard.h" | 11 | #include "input_common/drivers/keyboard.h" |
| 12 | #include "input_common/drivers/mouse.h" | 12 | #include "input_common/drivers/mouse.h" |
| @@ -126,9 +126,9 @@ ConfigureRingController::ConfigureRingController(QWidget* parent, | |||
| 126 | ui->buttonRingAnalogPush, | 126 | ui->buttonRingAnalogPush, |
| 127 | }; | 127 | }; |
| 128 | 128 | ||
| 129 | emulated_device = hid_core_.GetEmulatedDevices(); | 129 | emulated_controller = hid_core_.GetEmulatedController(Core::HID::NpadIdType::Player1); |
| 130 | emulated_device->SaveCurrentConfig(); | 130 | emulated_controller->SaveCurrentConfig(); |
| 131 | emulated_device->EnableConfiguration(); | 131 | emulated_controller->EnableConfiguration(); |
| 132 | 132 | ||
| 133 | LoadConfiguration(); | 133 | LoadConfiguration(); |
| 134 | 134 | ||
| @@ -143,9 +143,9 @@ ConfigureRingController::ConfigureRingController(QWidget* parent, | |||
| 143 | HandleClick( | 143 | HandleClick( |
| 144 | analog_map_buttons[sub_button_id], | 144 | analog_map_buttons[sub_button_id], |
| 145 | [=, this](const Common::ParamPackage& params) { | 145 | [=, this](const Common::ParamPackage& params) { |
| 146 | Common::ParamPackage param = emulated_device->GetRingParam(); | 146 | Common::ParamPackage param = emulated_controller->GetRingParam(); |
| 147 | SetAnalogParam(params, param, analog_sub_buttons[sub_button_id]); | 147 | SetAnalogParam(params, param, analog_sub_buttons[sub_button_id]); |
| 148 | emulated_device->SetRingParam(param); | 148 | emulated_controller->SetRingParam(param); |
| 149 | }, | 149 | }, |
| 150 | InputCommon::Polling::InputType::Stick); | 150 | InputCommon::Polling::InputType::Stick); |
| 151 | }); | 151 | }); |
| @@ -155,16 +155,16 @@ ConfigureRingController::ConfigureRingController(QWidget* parent, | |||
| 155 | connect(analog_button, &QPushButton::customContextMenuRequested, | 155 | connect(analog_button, &QPushButton::customContextMenuRequested, |
| 156 | [=, this](const QPoint& menu_location) { | 156 | [=, this](const QPoint& menu_location) { |
| 157 | QMenu context_menu; | 157 | QMenu context_menu; |
| 158 | Common::ParamPackage param = emulated_device->GetRingParam(); | 158 | Common::ParamPackage param = emulated_controller->GetRingParam(); |
| 159 | context_menu.addAction(tr("Clear"), [&] { | 159 | context_menu.addAction(tr("Clear"), [&] { |
| 160 | emulated_device->SetRingParam({}); | 160 | emulated_controller->SetRingParam(param); |
| 161 | analog_map_buttons[sub_button_id]->setText(tr("[not set]")); | 161 | analog_map_buttons[sub_button_id]->setText(tr("[not set]")); |
| 162 | }); | 162 | }); |
| 163 | context_menu.addAction(tr("Invert axis"), [&] { | 163 | context_menu.addAction(tr("Invert axis"), [&] { |
| 164 | const bool invert_value = param.Get("invert_x", "+") == "-"; | 164 | const bool invert_value = param.Get("invert_x", "+") == "-"; |
| 165 | const std::string invert_str = invert_value ? "+" : "-"; | 165 | const std::string invert_str = invert_value ? "+" : "-"; |
| 166 | param.Set("invert_x", invert_str); | 166 | param.Set("invert_x", invert_str); |
| 167 | emulated_device->SetRingParam(param); | 167 | emulated_controller->SetRingParam(param); |
| 168 | for (int sub_button_id2 = 0; sub_button_id2 < ANALOG_SUB_BUTTONS_NUM; | 168 | for (int sub_button_id2 = 0; sub_button_id2 < ANALOG_SUB_BUTTONS_NUM; |
| 169 | ++sub_button_id2) { | 169 | ++sub_button_id2) { |
| 170 | analog_map_buttons[sub_button_id2]->setText( | 170 | analog_map_buttons[sub_button_id2]->setText( |
| @@ -177,11 +177,11 @@ ConfigureRingController::ConfigureRingController(QWidget* parent, | |||
| 177 | } | 177 | } |
| 178 | 178 | ||
| 179 | connect(ui->sliderRingAnalogDeadzone, &QSlider::valueChanged, [=, this] { | 179 | connect(ui->sliderRingAnalogDeadzone, &QSlider::valueChanged, [=, this] { |
| 180 | Common::ParamPackage param = emulated_device->GetRingParam(); | 180 | Common::ParamPackage param = emulated_controller->GetRingParam(); |
| 181 | const auto slider_value = ui->sliderRingAnalogDeadzone->value(); | 181 | const auto slider_value = ui->sliderRingAnalogDeadzone->value(); |
| 182 | ui->labelRingAnalogDeadzone->setText(tr("Deadzone: %1%").arg(slider_value)); | 182 | ui->labelRingAnalogDeadzone->setText(tr("Deadzone: %1%").arg(slider_value)); |
| 183 | param.Set("deadzone", slider_value / 100.0f); | 183 | param.Set("deadzone", slider_value / 100.0f); |
| 184 | emulated_device->SetRingParam(param); | 184 | emulated_controller->SetRingParam(param); |
| 185 | }); | 185 | }); |
| 186 | 186 | ||
| 187 | connect(ui->restore_defaults_button, &QPushButton::clicked, this, | 187 | connect(ui->restore_defaults_button, &QPushButton::clicked, this, |
| @@ -202,7 +202,7 @@ ConfigureRingController::ConfigureRingController(QWidget* parent, | |||
| 202 | } | 202 | } |
| 203 | 203 | ||
| 204 | ConfigureRingController::~ConfigureRingController() { | 204 | ConfigureRingController::~ConfigureRingController() { |
| 205 | emulated_device->DisableConfiguration(); | 205 | emulated_controller->DisableConfiguration(); |
| 206 | }; | 206 | }; |
| 207 | 207 | ||
| 208 | void ConfigureRingController::changeEvent(QEvent* event) { | 208 | void ConfigureRingController::changeEvent(QEvent* event) { |
| @@ -219,7 +219,7 @@ void ConfigureRingController::RetranslateUI() { | |||
| 219 | 219 | ||
| 220 | void ConfigureRingController::UpdateUI() { | 220 | void ConfigureRingController::UpdateUI() { |
| 221 | RetranslateUI(); | 221 | RetranslateUI(); |
| 222 | const Common::ParamPackage param = emulated_device->GetRingParam(); | 222 | const Common::ParamPackage param = emulated_controller->GetRingParam(); |
| 223 | 223 | ||
| 224 | for (int sub_button_id = 0; sub_button_id < ANALOG_SUB_BUTTONS_NUM; ++sub_button_id) { | 224 | for (int sub_button_id = 0; sub_button_id < ANALOG_SUB_BUTTONS_NUM; ++sub_button_id) { |
| 225 | auto* const analog_button = analog_map_buttons[sub_button_id]; | 225 | auto* const analog_button = analog_map_buttons[sub_button_id]; |
| @@ -240,9 +240,9 @@ void ConfigureRingController::UpdateUI() { | |||
| 240 | } | 240 | } |
| 241 | 241 | ||
| 242 | void ConfigureRingController::ApplyConfiguration() { | 242 | void ConfigureRingController::ApplyConfiguration() { |
| 243 | emulated_device->DisableConfiguration(); | 243 | emulated_controller->DisableConfiguration(); |
| 244 | emulated_device->SaveCurrentConfig(); | 244 | emulated_controller->SaveCurrentConfig(); |
| 245 | emulated_device->EnableConfiguration(); | 245 | emulated_controller->EnableConfiguration(); |
| 246 | } | 246 | } |
| 247 | 247 | ||
| 248 | void ConfigureRingController::LoadConfiguration() { | 248 | void ConfigureRingController::LoadConfiguration() { |
| @@ -252,7 +252,7 @@ void ConfigureRingController::LoadConfiguration() { | |||
| 252 | void ConfigureRingController::RestoreDefaults() { | 252 | void ConfigureRingController::RestoreDefaults() { |
| 253 | const std::string default_ring_string = InputCommon::GenerateAnalogParamFromKeys( | 253 | const std::string default_ring_string = InputCommon::GenerateAnalogParamFromKeys( |
| 254 | 0, 0, Config::default_ringcon_analogs[0], Config::default_ringcon_analogs[1], 0, 0.05f); | 254 | 0, 0, Config::default_ringcon_analogs[0], Config::default_ringcon_analogs[1], 0, 0.05f); |
| 255 | emulated_device->SetRingParam(Common::ParamPackage(default_ring_string)); | 255 | emulated_controller->SetRingParam(Common::ParamPackage(default_ring_string)); |
| 256 | UpdateUI(); | 256 | UpdateUI(); |
| 257 | } | 257 | } |
| 258 | 258 | ||
diff --git a/src/yuzu/configuration/configure_ringcon.h b/src/yuzu/configuration/configure_ringcon.h index 38a9cb716..6e693e0dd 100644 --- a/src/yuzu/configuration/configure_ringcon.h +++ b/src/yuzu/configuration/configure_ringcon.h | |||
| @@ -13,7 +13,7 @@ class InputSubsystem; | |||
| 13 | 13 | ||
| 14 | namespace Core::HID { | 14 | namespace Core::HID { |
| 15 | class HIDCore; | 15 | class HIDCore; |
| 16 | class EmulatedDevices; | 16 | class EmulatedController; |
| 17 | } // namespace Core::HID | 17 | } // namespace Core::HID |
| 18 | 18 | ||
| 19 | namespace Ui { | 19 | namespace Ui { |
| @@ -78,7 +78,7 @@ private: | |||
| 78 | std::optional<std::function<void(const Common::ParamPackage&)>> input_setter; | 78 | std::optional<std::function<void(const Common::ParamPackage&)>> input_setter; |
| 79 | 79 | ||
| 80 | InputCommon::InputSubsystem* input_subsystem; | 80 | InputCommon::InputSubsystem* input_subsystem; |
| 81 | Core::HID::EmulatedDevices* emulated_device; | 81 | Core::HID::EmulatedController* emulated_controller; |
| 82 | 82 | ||
| 83 | std::unique_ptr<Ui::ConfigureRingController> ui; | 83 | std::unique_ptr<Ui::ConfigureRingController> ui; |
| 84 | }; | 84 | }; |