diff options
| author | 2021-11-03 22:35:45 -0600 | |
|---|---|---|
| committer | 2021-11-24 20:30:27 -0600 | |
| commit | 84c58666a4dbb6d46e132514e4d91437fb689fa0 (patch) | |
| tree | 4d6196522922374c927f9139bd22c28ea8cad279 | |
| parent | input_common: Fix motion from 3 axis (diff) | |
| download | yuzu-84c58666a4dbb6d46e132514e4d91437fb689fa0.tar.gz yuzu-84c58666a4dbb6d46e132514e4d91437fb689fa0.tar.xz yuzu-84c58666a4dbb6d46e132514e4d91437fb689fa0.zip | |
config: Cleanup and documentation
Diffstat (limited to '')
| -rw-r--r-- | src/common/input.h | 34 | ||||
| -rw-r--r-- | src/common/settings.h | 3 | ||||
| -rw-r--r-- | src/core/hid/emulated_console.cpp | 6 | ||||
| -rw-r--r-- | src/yuzu/configuration/config.cpp | 4 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_motion_touch.cpp | 8 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_motion_touch.ui | 70 | ||||
| -rw-r--r-- | src/yuzu_cmd/config.cpp | 3 | ||||
| -rw-r--r-- | src/yuzu_cmd/default_ini.h | 17 |
8 files changed, 46 insertions, 99 deletions
diff --git a/src/common/input.h b/src/common/input.h index f21872b0a..d997853c6 100644 --- a/src/common/input.h +++ b/src/common/input.h | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | 15 | ||
| 16 | namespace Common::Input { | 16 | namespace Common::Input { |
| 17 | 17 | ||
| 18 | // Type of data that is expected to recieve or send | ||
| 18 | enum class InputType { | 19 | enum class InputType { |
| 19 | None, | 20 | None, |
| 20 | Battery, | 21 | Battery, |
| @@ -30,6 +31,7 @@ enum class InputType { | |||
| 30 | Ir, | 31 | Ir, |
| 31 | }; | 32 | }; |
| 32 | 33 | ||
| 34 | // Internal battery charge level | ||
| 33 | enum class BatteryLevel : u32 { | 35 | enum class BatteryLevel : u32 { |
| 34 | None, | 36 | None, |
| 35 | Empty, | 37 | Empty, |
| @@ -41,13 +43,17 @@ enum class BatteryLevel : u32 { | |||
| 41 | }; | 43 | }; |
| 42 | 44 | ||
| 43 | enum class PollingMode { | 45 | enum class PollingMode { |
| 46 | // Constant polling of buttons, analogs and motion data | ||
| 44 | Active, | 47 | Active, |
| 48 | // Only update on button change, digital analogs | ||
| 45 | Pasive, | 49 | Pasive, |
| 46 | Camera, | 50 | // Enable near field communication polling |
| 47 | NCF, | 51 | NFC, |
| 52 | // Enable infrared camera polling | ||
| 48 | IR, | 53 | IR, |
| 49 | }; | 54 | }; |
| 50 | 55 | ||
| 56 | // Vibration reply from the controller | ||
| 51 | enum class VibrationError { | 57 | enum class VibrationError { |
| 52 | None, | 58 | None, |
| 53 | NotSupported, | 59 | NotSupported, |
| @@ -55,6 +61,7 @@ enum class VibrationError { | |||
| 55 | Unknown, | 61 | Unknown, |
| 56 | }; | 62 | }; |
| 57 | 63 | ||
| 64 | // Polling mode reply from the controller | ||
| 58 | enum class PollingError { | 65 | enum class PollingError { |
| 59 | None, | 66 | None, |
| 60 | NotSupported, | 67 | NotSupported, |
| @@ -67,20 +74,28 @@ enum class VibrationAmplificationType { | |||
| 67 | Exponential, | 74 | Exponential, |
| 68 | }; | 75 | }; |
| 69 | 76 | ||
| 77 | // Analog properties for calibration | ||
| 70 | struct AnalogProperties { | 78 | struct AnalogProperties { |
| 79 | // Anything below this value will be detected as zero | ||
| 71 | float deadzone{}; | 80 | float deadzone{}; |
| 81 | // Anyting above this values will be detected as one | ||
| 72 | float range{1.0f}; | 82 | float range{1.0f}; |
| 83 | // Minimum value to be detected as active | ||
| 73 | float threshold{0.5f}; | 84 | float threshold{0.5f}; |
| 85 | // Drift correction applied to the raw data | ||
| 74 | float offset{}; | 86 | float offset{}; |
| 87 | // Invert direction of the sensor data | ||
| 75 | bool inverted{}; | 88 | bool inverted{}; |
| 76 | }; | 89 | }; |
| 77 | 90 | ||
| 91 | // Single analog sensor data | ||
| 78 | struct AnalogStatus { | 92 | struct AnalogStatus { |
| 79 | float value{}; | 93 | float value{}; |
| 80 | float raw_value{}; | 94 | float raw_value{}; |
| 81 | AnalogProperties properties{}; | 95 | AnalogProperties properties{}; |
| 82 | }; | 96 | }; |
| 83 | 97 | ||
| 98 | // Button data | ||
| 84 | struct ButtonStatus { | 99 | struct ButtonStatus { |
| 85 | Common::UUID uuid{}; | 100 | Common::UUID uuid{}; |
| 86 | bool value{}; | 101 | bool value{}; |
| @@ -89,8 +104,10 @@ struct ButtonStatus { | |||
| 89 | bool locked{}; | 104 | bool locked{}; |
| 90 | }; | 105 | }; |
| 91 | 106 | ||
| 107 | // Internal battery data | ||
| 92 | using BatteryStatus = BatteryLevel; | 108 | using BatteryStatus = BatteryLevel; |
| 93 | 109 | ||
| 110 | // Analog and digital joystick data | ||
| 94 | struct StickStatus { | 111 | struct StickStatus { |
| 95 | Common::UUID uuid{}; | 112 | Common::UUID uuid{}; |
| 96 | AnalogStatus x{}; | 113 | AnalogStatus x{}; |
| @@ -101,18 +118,21 @@ struct StickStatus { | |||
| 101 | bool down{}; | 118 | bool down{}; |
| 102 | }; | 119 | }; |
| 103 | 120 | ||
| 121 | // Analog and digital trigger data | ||
| 104 | struct TriggerStatus { | 122 | struct TriggerStatus { |
| 105 | Common::UUID uuid{}; | 123 | Common::UUID uuid{}; |
| 106 | AnalogStatus analog{}; | 124 | AnalogStatus analog{}; |
| 107 | ButtonStatus pressed{}; | 125 | ButtonStatus pressed{}; |
| 108 | }; | 126 | }; |
| 109 | 127 | ||
| 128 | // 3D vector representing motion input | ||
| 110 | struct MotionSensor { | 129 | struct MotionSensor { |
| 111 | AnalogStatus x{}; | 130 | AnalogStatus x{}; |
| 112 | AnalogStatus y{}; | 131 | AnalogStatus y{}; |
| 113 | AnalogStatus z{}; | 132 | AnalogStatus z{}; |
| 114 | }; | 133 | }; |
| 115 | 134 | ||
| 135 | // Motion data used to calculate controller orientation | ||
| 116 | struct MotionStatus { | 136 | struct MotionStatus { |
| 117 | // Gyroscope vector measurement in radians/s. | 137 | // Gyroscope vector measurement in radians/s. |
| 118 | MotionSensor gyro{}; | 138 | MotionSensor gyro{}; |
| @@ -124,6 +144,7 @@ struct MotionStatus { | |||
| 124 | bool force_update{}; | 144 | bool force_update{}; |
| 125 | }; | 145 | }; |
| 126 | 146 | ||
| 147 | // Data of a single point on a touch screen | ||
| 127 | struct TouchStatus { | 148 | struct TouchStatus { |
| 128 | ButtonStatus pressed{}; | 149 | ButtonStatus pressed{}; |
| 129 | AnalogStatus x{}; | 150 | AnalogStatus x{}; |
| @@ -131,11 +152,13 @@ struct TouchStatus { | |||
| 131 | int id{}; | 152 | int id{}; |
| 132 | }; | 153 | }; |
| 133 | 154 | ||
| 155 | // Physical controller color in RGB format | ||
| 134 | struct BodyColorStatus { | 156 | struct BodyColorStatus { |
| 135 | u32 body{}; | 157 | u32 body{}; |
| 136 | u32 buttons{}; | 158 | u32 buttons{}; |
| 137 | }; | 159 | }; |
| 138 | 160 | ||
| 161 | // HD rumble data | ||
| 139 | struct VibrationStatus { | 162 | struct VibrationStatus { |
| 140 | f32 low_amplitude{}; | 163 | f32 low_amplitude{}; |
| 141 | f32 low_frequency{}; | 164 | f32 low_frequency{}; |
| @@ -144,6 +167,7 @@ struct VibrationStatus { | |||
| 144 | VibrationAmplificationType type; | 167 | VibrationAmplificationType type; |
| 145 | }; | 168 | }; |
| 146 | 169 | ||
| 170 | // Physical controller LED pattern | ||
| 147 | struct LedStatus { | 171 | struct LedStatus { |
| 148 | bool led_1{}; | 172 | bool led_1{}; |
| 149 | bool led_2{}; | 173 | bool led_2{}; |
| @@ -151,6 +175,7 @@ struct LedStatus { | |||
| 151 | bool led_4{}; | 175 | bool led_4{}; |
| 152 | }; | 176 | }; |
| 153 | 177 | ||
| 178 | // Callback data consisting of an input type and the equivalent data status | ||
| 154 | struct CallbackStatus { | 179 | struct CallbackStatus { |
| 155 | InputType type{InputType::None}; | 180 | InputType type{InputType::None}; |
| 156 | ButtonStatus button_status{}; | 181 | ButtonStatus button_status{}; |
| @@ -164,6 +189,7 @@ struct CallbackStatus { | |||
| 164 | VibrationStatus vibration_status{}; | 189 | VibrationStatus vibration_status{}; |
| 165 | }; | 190 | }; |
| 166 | 191 | ||
| 192 | // Triggered once every input change | ||
| 167 | struct InputCallback { | 193 | struct InputCallback { |
| 168 | std::function<void(CallbackStatus)> on_change; | 194 | std::function<void(CallbackStatus)> on_change; |
| 169 | }; | 195 | }; |
| @@ -178,15 +204,17 @@ public: | |||
| 178 | return; | 204 | return; |
| 179 | } | 205 | } |
| 180 | 206 | ||
| 181 | // Force input device to update data regarless of the current state | 207 | // Force input device to update data regardless of the current state |
| 182 | virtual void ForceUpdate() { | 208 | virtual void ForceUpdate() { |
| 183 | return; | 209 | return; |
| 184 | } | 210 | } |
| 185 | 211 | ||
| 212 | // Sets the function to be triggered when input changes | ||
| 186 | void SetCallback(InputCallback callback_) { | 213 | void SetCallback(InputCallback callback_) { |
| 187 | callback = std::move(callback_); | 214 | callback = std::move(callback_); |
| 188 | } | 215 | } |
| 189 | 216 | ||
| 217 | // Triggers the function set in the callback | ||
| 190 | void TriggerOnChange(CallbackStatus status) { | 218 | void TriggerOnChange(CallbackStatus status) { |
| 191 | if (callback.on_change) { | 219 | if (callback.on_change) { |
| 192 | callback.on_change(status); | 220 | callback.on_change(status); |
diff --git a/src/common/settings.h b/src/common/settings.h index 95225fba7..b52d0d1d0 100644 --- a/src/common/settings.h +++ b/src/common/settings.h | |||
| @@ -559,8 +559,6 @@ struct Values { | |||
| 559 | Setting<bool> enable_accurate_vibrations{false, "enable_accurate_vibrations"}; | 559 | Setting<bool> enable_accurate_vibrations{false, "enable_accurate_vibrations"}; |
| 560 | 560 | ||
| 561 | Setting<bool> motion_enabled{true, "motion_enabled"}; | 561 | Setting<bool> motion_enabled{true, "motion_enabled"}; |
| 562 | BasicSetting<std::string> motion_device{"engine:motion_emu,update_period:100,sensitivity:0.01", | ||
| 563 | "motion_device"}; | ||
| 564 | BasicSetting<std::string> udp_input_servers{"127.0.0.1:26760", "udp_input_servers"}; | 562 | BasicSetting<std::string> udp_input_servers{"127.0.0.1:26760", "udp_input_servers"}; |
| 565 | 563 | ||
| 566 | BasicSetting<bool> pause_tas_on_load{true, "pause_tas_on_load"}; | 564 | BasicSetting<bool> pause_tas_on_load{true, "pause_tas_on_load"}; |
| @@ -583,7 +581,6 @@ struct Values { | |||
| 583 | 581 | ||
| 584 | TouchscreenInput touchscreen; | 582 | TouchscreenInput touchscreen; |
| 585 | 583 | ||
| 586 | BasicSetting<bool> use_touch_from_button{false, "use_touch_from_button"}; | ||
| 587 | BasicSetting<std::string> touch_device{"min_x:100,min_y:50,max_x:1800,max_y:850", | 584 | BasicSetting<std::string> touch_device{"min_x:100,min_y:50,max_x:1800,max_y:850", |
| 588 | "touch_device"}; | 585 | "touch_device"}; |
| 589 | BasicSetting<int> touch_from_button_map_index{0, "touch_from_button_map"}; | 586 | BasicSetting<int> touch_from_button_map_index{0, "touch_from_button_map"}; |
diff --git a/src/core/hid/emulated_console.cpp b/src/core/hid/emulated_console.cpp index dfbaa3f8c..b51c72eae 100644 --- a/src/core/hid/emulated_console.cpp +++ b/src/core/hid/emulated_console.cpp | |||
| @@ -11,7 +11,7 @@ EmulatedConsole::EmulatedConsole() = default; | |||
| 11 | EmulatedConsole::~EmulatedConsole() = default; | 11 | EmulatedConsole::~EmulatedConsole() = default; |
| 12 | 12 | ||
| 13 | void EmulatedConsole::ReloadFromSettings() { | 13 | void EmulatedConsole::ReloadFromSettings() { |
| 14 | // Using first motion device from player 1. No need to assign a special config at the moment | 14 | // Using first motion device from player 1. No need to assign any unique config at the moment |
| 15 | const auto& player = Settings::values.players.GetValue()[0]; | 15 | const auto& player = Settings::values.players.GetValue()[0]; |
| 16 | motion_params = Common::ParamPackage(player.motions[0]); | 16 | motion_params = Common::ParamPackage(player.motions[0]); |
| 17 | 17 | ||
| @@ -33,6 +33,7 @@ void EmulatedConsole::SetTouchParams() { | |||
| 33 | static_cast<u64>(Settings::values.touch_from_button_map_index.GetValue()); | 33 | static_cast<u64>(Settings::values.touch_from_button_map_index.GetValue()); |
| 34 | const auto& touch_buttons = Settings::values.touch_from_button_maps[button_index].buttons; | 34 | const auto& touch_buttons = Settings::values.touch_from_button_maps[button_index].buttons; |
| 35 | 35 | ||
| 36 | // Map the rest of the fingers from touch from button configuration | ||
| 36 | for (const auto& config_entry : touch_buttons) { | 37 | for (const auto& config_entry : touch_buttons) { |
| 37 | Common::ParamPackage params{config_entry}; | 38 | Common::ParamPackage params{config_entry}; |
| 38 | Common::ParamPackage touch_button_params; | 39 | Common::ParamPackage touch_button_params; |
| @@ -54,7 +55,9 @@ void EmulatedConsole::SetTouchParams() { | |||
| 54 | } | 55 | } |
| 55 | 56 | ||
| 56 | void EmulatedConsole::ReloadInput() { | 57 | void EmulatedConsole::ReloadInput() { |
| 58 | // If you load any device here add the equivalent to the UnloadInput() function | ||
| 57 | SetTouchParams(); | 59 | SetTouchParams(); |
| 60 | |||
| 58 | motion_devices = Common::Input::CreateDevice<Common::Input::InputDevice>(motion_params); | 61 | motion_devices = Common::Input::CreateDevice<Common::Input::InputDevice>(motion_params); |
| 59 | if (motion_devices) { | 62 | if (motion_devices) { |
| 60 | Common::Input::InputCallback motion_callback{ | 63 | Common::Input::InputCallback motion_callback{ |
| @@ -62,6 +65,7 @@ void EmulatedConsole::ReloadInput() { | |||
| 62 | motion_devices->SetCallback(motion_callback); | 65 | motion_devices->SetCallback(motion_callback); |
| 63 | } | 66 | } |
| 64 | 67 | ||
| 68 | // Unique index for identifying touch device source | ||
| 65 | std::size_t index = 0; | 69 | std::size_t index = 0; |
| 66 | for (auto& touch_device : touch_devices) { | 70 | for (auto& touch_device : touch_devices) { |
| 67 | touch_device = Common::Input::CreateDevice<Common::Input::InputDevice>(touch_params[index]); | 71 | touch_device = Common::Input::CreateDevice<Common::Input::InputDevice>(touch_params[index]); |
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index 7a748d9c8..7669fe474 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp | |||
| @@ -623,9 +623,7 @@ void Config::ReadMotionTouchValues() { | |||
| 623 | } | 623 | } |
| 624 | qt_config->endArray(); | 624 | qt_config->endArray(); |
| 625 | 625 | ||
| 626 | ReadBasicSetting(Settings::values.motion_device); | ||
| 627 | ReadBasicSetting(Settings::values.touch_device); | 626 | ReadBasicSetting(Settings::values.touch_device); |
| 628 | ReadBasicSetting(Settings::values.use_touch_from_button); | ||
| 629 | ReadBasicSetting(Settings::values.touch_from_button_map_index); | 627 | ReadBasicSetting(Settings::values.touch_from_button_map_index); |
| 630 | Settings::values.touch_from_button_map_index = std::clamp( | 628 | Settings::values.touch_from_button_map_index = std::clamp( |
| 631 | Settings::values.touch_from_button_map_index.GetValue(), 0, num_touch_from_button_maps - 1); | 629 | Settings::values.touch_from_button_map_index.GetValue(), 0, num_touch_from_button_maps - 1); |
| @@ -1131,9 +1129,7 @@ void Config::SaveTouchscreenValues() { | |||
| 1131 | } | 1129 | } |
| 1132 | 1130 | ||
| 1133 | void Config::SaveMotionTouchValues() { | 1131 | void Config::SaveMotionTouchValues() { |
| 1134 | WriteBasicSetting(Settings::values.motion_device); | ||
| 1135 | WriteBasicSetting(Settings::values.touch_device); | 1132 | WriteBasicSetting(Settings::values.touch_device); |
| 1136 | WriteBasicSetting(Settings::values.use_touch_from_button); | ||
| 1137 | WriteBasicSetting(Settings::values.touch_from_button_map_index); | 1133 | WriteBasicSetting(Settings::values.touch_from_button_map_index); |
| 1138 | WriteBasicSetting(Settings::values.udp_input_servers); | 1134 | WriteBasicSetting(Settings::values.udp_input_servers); |
| 1139 | 1135 | ||
diff --git a/src/yuzu/configuration/configure_motion_touch.cpp b/src/yuzu/configuration/configure_motion_touch.cpp index 9fd1a919f..8539a5c8b 100644 --- a/src/yuzu/configuration/configure_motion_touch.cpp +++ b/src/yuzu/configuration/configure_motion_touch.cpp | |||
| @@ -93,6 +93,7 @@ ConfigureMotionTouch::ConfigureMotionTouch(QWidget* parent, | |||
| 93 | "using-a-controller-or-android-phone-for-motion-or-touch-input'><span " | 93 | "using-a-controller-or-android-phone-for-motion-or-touch-input'><span " |
| 94 | "style=\"text-decoration: underline; color:#039be5;\">Learn More</span></a>")); | 94 | "style=\"text-decoration: underline; color:#039be5;\">Learn More</span></a>")); |
| 95 | 95 | ||
| 96 | setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); | ||
| 96 | SetConfiguration(); | 97 | SetConfiguration(); |
| 97 | UpdateUiDisplay(); | 98 | UpdateUiDisplay(); |
| 98 | ConnectEvents(); | 99 | ConnectEvents(); |
| @@ -101,17 +102,14 @@ ConfigureMotionTouch::ConfigureMotionTouch(QWidget* parent, | |||
| 101 | ConfigureMotionTouch::~ConfigureMotionTouch() = default; | 102 | ConfigureMotionTouch::~ConfigureMotionTouch() = default; |
| 102 | 103 | ||
| 103 | void ConfigureMotionTouch::SetConfiguration() { | 104 | void ConfigureMotionTouch::SetConfiguration() { |
| 104 | const Common::ParamPackage motion_param(Settings::values.motion_device.GetValue()); | ||
| 105 | const Common::ParamPackage touch_param(Settings::values.touch_device.GetValue()); | 105 | const Common::ParamPackage touch_param(Settings::values.touch_device.GetValue()); |
| 106 | 106 | ||
| 107 | ui->touch_from_button_checkbox->setChecked(Settings::values.use_touch_from_button.GetValue()); | ||
| 108 | touch_from_button_maps = Settings::values.touch_from_button_maps; | 107 | touch_from_button_maps = Settings::values.touch_from_button_maps; |
| 109 | for (const auto& touch_map : touch_from_button_maps) { | 108 | for (const auto& touch_map : touch_from_button_maps) { |
| 110 | ui->touch_from_button_map->addItem(QString::fromStdString(touch_map.name)); | 109 | ui->touch_from_button_map->addItem(QString::fromStdString(touch_map.name)); |
| 111 | } | 110 | } |
| 112 | ui->touch_from_button_map->setCurrentIndex( | 111 | ui->touch_from_button_map->setCurrentIndex( |
| 113 | Settings::values.touch_from_button_map_index.GetValue()); | 112 | Settings::values.touch_from_button_map_index.GetValue()); |
| 114 | ui->motion_sensitivity->setValue(motion_param.Get("sensitivity", 0.01f)); | ||
| 115 | 113 | ||
| 116 | min_x = touch_param.Get("min_x", 100); | 114 | min_x = touch_param.Get("min_x", 100); |
| 117 | min_y = touch_param.Get("min_y", 50); | 115 | min_y = touch_param.Get("min_y", 50); |
| @@ -139,9 +137,6 @@ void ConfigureMotionTouch::SetConfiguration() { | |||
| 139 | void ConfigureMotionTouch::UpdateUiDisplay() { | 137 | void ConfigureMotionTouch::UpdateUiDisplay() { |
| 140 | const QString cemuhook_udp = QStringLiteral("cemuhookudp"); | 138 | const QString cemuhook_udp = QStringLiteral("cemuhookudp"); |
| 141 | 139 | ||
| 142 | ui->motion_sensitivity_label->setVisible(true); | ||
| 143 | ui->motion_sensitivity->setVisible(true); | ||
| 144 | |||
| 145 | ui->touch_calibration->setVisible(true); | 140 | ui->touch_calibration->setVisible(true); |
| 146 | ui->touch_calibration_config->setVisible(true); | 141 | ui->touch_calibration_config->setVisible(true); |
| 147 | ui->touch_calibration_label->setVisible(true); | 142 | ui->touch_calibration_label->setVisible(true); |
| @@ -312,7 +307,6 @@ void ConfigureMotionTouch::ApplyConfiguration() { | |||
| 312 | touch_param.Set("max_y", max_y); | 307 | touch_param.Set("max_y", max_y); |
| 313 | 308 | ||
| 314 | Settings::values.touch_device = touch_param.Serialize(); | 309 | Settings::values.touch_device = touch_param.Serialize(); |
| 315 | Settings::values.use_touch_from_button = ui->touch_from_button_checkbox->isChecked(); | ||
| 316 | Settings::values.touch_from_button_map_index = ui->touch_from_button_map->currentIndex(); | 310 | Settings::values.touch_from_button_map_index = ui->touch_from_button_map->currentIndex(); |
| 317 | Settings::values.touch_from_button_maps = touch_from_button_maps; | 311 | Settings::values.touch_from_button_maps = touch_from_button_maps; |
| 318 | Settings::values.udp_input_servers = GetUDPServerString(); | 312 | Settings::values.udp_input_servers = GetUDPServerString(); |
diff --git a/src/yuzu/configuration/configure_motion_touch.ui b/src/yuzu/configuration/configure_motion_touch.ui index 1e35ea946..c75a84ae4 100644 --- a/src/yuzu/configuration/configure_motion_touch.ui +++ b/src/yuzu/configuration/configure_motion_touch.ui | |||
| @@ -2,14 +2,6 @@ | |||
| 2 | <ui version="4.0"> | 2 | <ui version="4.0"> |
| 3 | <class>ConfigureMotionTouch</class> | 3 | <class>ConfigureMotionTouch</class> |
| 4 | <widget class="QDialog" name="ConfigureMotionTouch"> | 4 | <widget class="QDialog" name="ConfigureMotionTouch"> |
| 5 | <property name="geometry"> | ||
| 6 | <rect> | ||
| 7 | <x>0</x> | ||
| 8 | <y>0</y> | ||
| 9 | <width>500</width> | ||
| 10 | <height>482</height> | ||
| 11 | </rect> | ||
| 12 | </property> | ||
| 13 | <property name="windowTitle"> | 5 | <property name="windowTitle"> |
| 14 | <string>Configure Motion / Touch</string> | 6 | <string>Configure Motion / Touch</string> |
| 15 | </property> | 7 | </property> |
| @@ -18,48 +10,6 @@ | |||
| 18 | </property> | 10 | </property> |
| 19 | <layout class="QVBoxLayout"> | 11 | <layout class="QVBoxLayout"> |
| 20 | <item> | 12 | <item> |
| 21 | <widget class="QGroupBox" name="motion_group_box"> | ||
| 22 | <property name="title"> | ||
| 23 | <string>Mouse Motion</string> | ||
| 24 | </property> | ||
| 25 | <layout class="QVBoxLayout"> | ||
| 26 | <item> | ||
| 27 | <layout class="QHBoxLayout"> | ||
| 28 | <item> | ||
| 29 | <widget class="QLabel" name="motion_sensitivity_label"> | ||
| 30 | <property name="text"> | ||
| 31 | <string>Sensitivity:</string> | ||
| 32 | </property> | ||
| 33 | </widget> | ||
| 34 | </item> | ||
| 35 | <item> | ||
| 36 | <widget class="QDoubleSpinBox" name="motion_sensitivity"> | ||
| 37 | <property name="alignment"> | ||
| 38 | <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> | ||
| 39 | </property> | ||
| 40 | <property name="decimals"> | ||
| 41 | <number>4</number> | ||
| 42 | </property> | ||
| 43 | <property name="minimum"> | ||
| 44 | <double>0.010000000000000</double> | ||
| 45 | </property> | ||
| 46 | <property name="maximum"> | ||
| 47 | <double>10.000000000000000</double> | ||
| 48 | </property> | ||
| 49 | <property name="singleStep"> | ||
| 50 | <double>0.001000000000000</double> | ||
| 51 | </property> | ||
| 52 | <property name="value"> | ||
| 53 | <double>0.010000000000000</double> | ||
| 54 | </property> | ||
| 55 | </widget> | ||
| 56 | </item> | ||
| 57 | </layout> | ||
| 58 | </item> | ||
| 59 | </layout> | ||
| 60 | </widget> | ||
| 61 | </item> | ||
| 62 | <item> | ||
| 63 | <widget class="QGroupBox" name="touch_group_box"> | 13 | <widget class="QGroupBox" name="touch_group_box"> |
| 64 | <property name="title"> | 14 | <property name="title"> |
| 65 | <string>Touch</string> | 15 | <string>Touch</string> |
| @@ -101,19 +51,13 @@ | |||
| 101 | </item> | 51 | </item> |
| 102 | <item> | 52 | <item> |
| 103 | <layout class="QHBoxLayout"> | 53 | <layout class="QHBoxLayout"> |
| 104 | <item> | 54 | <item> |
| 105 | <widget class="QCheckBox" name="touch_from_button_checkbox"> | 55 | <widget class="QLabel" name="touch_from_button_label"> |
| 106 | <property name="sizePolicy"> | 56 | <property name="text"> |
| 107 | <sizepolicy hsizetype="Maximum" vsizetype="Fixed"> | 57 | <string>Touch from button profile:</string> |
| 108 | <horstretch>0</horstretch> | 58 | </property> |
| 109 | <verstretch>0</verstretch> | 59 | </widget> |
| 110 | </sizepolicy> | 60 | </item> |
| 111 | </property> | ||
| 112 | <property name="text"> | ||
| 113 | <string>Use button mapping:</string> | ||
| 114 | </property> | ||
| 115 | </widget> | ||
| 116 | </item> | ||
| 117 | <item> | 61 | <item> |
| 118 | <widget class="QComboBox" name="touch_from_button_map"/> | 62 | <widget class="QComboBox" name="touch_from_button_map"/> |
| 119 | </item> | 63 | </item> |
diff --git a/src/yuzu_cmd/config.cpp b/src/yuzu_cmd/config.cpp index 103a12b12..7ca09a635 100644 --- a/src/yuzu_cmd/config.cpp +++ b/src/yuzu_cmd/config.cpp | |||
| @@ -292,8 +292,6 @@ void Config::ReadValues() { | |||
| 292 | Settings::values.mouse_buttons[i] = default_param; | 292 | Settings::values.mouse_buttons[i] = default_param; |
| 293 | } | 293 | } |
| 294 | 294 | ||
| 295 | ReadSetting("ControlsGeneral", Settings::values.motion_device); | ||
| 296 | |||
| 297 | ReadSetting("ControlsGeneral", Settings::values.touch_device); | 295 | ReadSetting("ControlsGeneral", Settings::values.touch_device); |
| 298 | 296 | ||
| 299 | ReadSetting("ControlsGeneral", Settings::values.keyboard_enabled); | 297 | ReadSetting("ControlsGeneral", Settings::values.keyboard_enabled); |
| @@ -362,7 +360,6 @@ void Config::ReadValues() { | |||
| 362 | Settings::TouchFromButtonMap{"default", {}}); | 360 | Settings::TouchFromButtonMap{"default", {}}); |
| 363 | num_touch_from_button_maps = 1; | 361 | num_touch_from_button_maps = 1; |
| 364 | } | 362 | } |
| 365 | ReadSetting("ControlsGeneral", Settings::values.use_touch_from_button); | ||
| 366 | Settings::values.touch_from_button_map_index = std::clamp( | 363 | Settings::values.touch_from_button_map_index = std::clamp( |
| 367 | Settings::values.touch_from_button_map_index.GetValue(), 0, num_touch_from_button_maps - 1); | 364 | Settings::values.touch_from_button_map_index.GetValue(), 0, num_touch_from_button_maps - 1); |
| 368 | 365 | ||
diff --git a/src/yuzu_cmd/default_ini.h b/src/yuzu_cmd/default_ini.h index ecdc271a8..6d613bf7a 100644 --- a/src/yuzu_cmd/default_ini.h +++ b/src/yuzu_cmd/default_ini.h | |||
| @@ -84,23 +84,10 @@ enable_accurate_vibrations= | |||
| 84 | # 0: Disabled, 1 (default): Enabled | 84 | # 0: Disabled, 1 (default): Enabled |
| 85 | motion_enabled = | 85 | motion_enabled = |
| 86 | 86 | ||
| 87 | # for motion input, the following devices are available: | 87 | # Defines the udp device's touch screen coordinate system for cemuhookudp devices |
| 88 | # - "motion_emu" (default) for emulating motion input from mouse input. Required parameters: | 88 | # - "min_x", "min_y", "max_x", "max_y" |
| 89 | # - "update_period": update period in milliseconds (default to 100) | ||
| 90 | # - "sensitivity": the coefficient converting mouse movement to tilting angle (default to 0.01) | ||
| 91 | # - "cemuhookudp" reads motion input from a udp server that uses cemuhook's udp protocol | ||
| 92 | motion_device= | ||
| 93 | |||
| 94 | # for touch input, the following devices are available: | ||
| 95 | # - "emu_window" (default) for emulating touch input from mouse input to the emulation window. No parameters required | ||
| 96 | # - "cemuhookudp" reads touch input from a udp server that uses cemuhook's udp protocol | ||
| 97 | # - "min_x", "min_y", "max_x", "max_y": defines the udp device's touch screen coordinate system | ||
| 98 | touch_device= | 89 | touch_device= |
| 99 | 90 | ||
| 100 | # Whether to enable or disable touch input from button | ||
| 101 | # 0 (default): Disabled, 1: Enabled | ||
| 102 | use_touch_from_button= | ||
| 103 | |||
| 104 | # for mapping buttons to touch inputs. | 91 | # for mapping buttons to touch inputs. |
| 105 | #touch_from_button_map=1 | 92 | #touch_from_button_map=1 |
| 106 | #touch_from_button_maps_0_name=default | 93 | #touch_from_button_maps_0_name=default |