diff options
-rw-r--r-- | src/yuzu/configuration/configure_input_player.cpp | 18 | ||||
-rw-r--r-- | src/yuzu/configuration/configure_vibration.cpp | 2 |
2 files changed, 18 insertions, 2 deletions
diff --git a/src/yuzu/configuration/configure_input_player.cpp b/src/yuzu/configuration/configure_input_player.cpp index f65a7fe73..72640f5e7 100644 --- a/src/yuzu/configuration/configure_input_player.cpp +++ b/src/yuzu/configuration/configure_input_player.cpp @@ -694,6 +694,8 @@ void ConfigureInputPlayer::UpdateInputDeviceCombobox() { const auto current_guid = button_param->Get("guid", ""); const auto current_port = button_param->Get("port", ""); + const bool is_keyboard_mouse = current_engine == "keyboard" || current_engine == "mouse"; + UpdateInputDevices(); if (buttons_empty) { @@ -702,13 +704,22 @@ void ConfigureInputPlayer::UpdateInputDeviceCombobox() { const bool all_one_device = std::all_of(buttons_param.begin(), buttons_param.end(), - [current_engine, current_guid, current_port](const Common::ParamPackage param) { + [current_engine, current_guid, current_port, + is_keyboard_mouse](const Common::ParamPackage param) { + if (is_keyboard_mouse) { + return !param.Has("engine") || param.Get("engine", "") == "keyboard" || + param.Get("engine", "") == "mouse"; + } return !param.Has("engine") || (param.Get("engine", "") == current_engine && param.Get("guid", "") == current_guid && param.Get("port", "") == current_port); }); if (all_one_device) { + if (is_keyboard_mouse) { + ui->comboDevices->setCurrentIndex(1); + return; + } const auto devices_it = std::find_if( input_devices.begin(), input_devices.end(), [current_engine, current_guid, current_port](const Common::ParamPackage param) { @@ -1073,6 +1084,11 @@ bool ConfigureInputPlayer::IsInputAcceptable(const Common::ParamPackage& params) return true; } + // Keyboard/Mouse + if (ui->comboDevices->currentIndex() == 1) { + return params.Get("engine", "") == "keyboard" || params.Get("engine", "") == "mouse"; + } + const auto current_input_device = input_devices[ui->comboDevices->currentIndex()]; return params.Get("engine", "") == current_input_device.Get("class", "") && params.Get("guid", "") == current_input_device.Get("guid", "") && diff --git a/src/yuzu/configuration/configure_vibration.cpp b/src/yuzu/configuration/configure_vibration.cpp index 714db5b80..7dcb2c5b9 100644 --- a/src/yuzu/configuration/configure_vibration.cpp +++ b/src/yuzu/configuration/configure_vibration.cpp @@ -99,7 +99,7 @@ void ConfigureVibration::SetVibrationDevices(std::size_t player_index) { const auto guid = param.Get("guid", ""); const auto port = param.Get("port", ""); - if (engine.empty() || engine == "keyboard") { + if (engine.empty() || engine == "keyboard" || engine == "mouse") { continue; } |