diff options
author | Morph <39850852+Morph1984@users.noreply.github.com> | 2020-11-11 13:46:41 +0100 |
---|---|---|
committer | Morph <39850852+Morph1984@users.noreply.github.com> | 2020-11-16 05:33:21 +0100 |
commit | b254d528bcdd8d826c87ef720b2c247a08cc5049 (patch) | |
tree | 1c9812df6e43ed73ce626ff34a58c8aaaf4cf34b | |
parent | hid: Reimplement Begin/EndPermitVibrationSession (diff) | |
download | yuzu-b254d528bcdd8d826c87ef720b2c247a08cc5049.tar yuzu-b254d528bcdd8d826c87ef720b2c247a08cc5049.tar.gz yuzu-b254d528bcdd8d826c87ef720b2c247a08cc5049.tar.bz2 yuzu-b254d528bcdd8d826c87ef720b2c247a08cc5049.tar.lz yuzu-b254d528bcdd8d826c87ef720b2c247a08cc5049.tar.xz yuzu-b254d528bcdd8d826c87ef720b2c247a08cc5049.tar.zst yuzu-b254d528bcdd8d826c87ef720b2c247a08cc5049.zip |
-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; } |