summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFearlessTobi <thm.frey@gmail.com>2020-04-05 07:16:09 +0200
committerFearlessTobi <thm.frey@gmail.com>2020-04-05 07:16:09 +0200
commitaa6214feb763170b1ba288a7fd656dc6a99cb23f (patch)
tree9acc5f1f8e7522a59f717444b440ecf6488b84b9 /src
parentyuzu/configure_input_simple: Fix "Docked Joycons" controller profile (diff)
downloadyuzu-aa6214feb763170b1ba288a7fd656dc6a99cb23f.tar
yuzu-aa6214feb763170b1ba288a7fd656dc6a99cb23f.tar.gz
yuzu-aa6214feb763170b1ba288a7fd656dc6a99cb23f.tar.bz2
yuzu-aa6214feb763170b1ba288a7fd656dc6a99cb23f.tar.lz
yuzu-aa6214feb763170b1ba288a7fd656dc6a99cb23f.tar.xz
yuzu-aa6214feb763170b1ba288a7fd656dc6a99cb23f.tar.zst
yuzu-aa6214feb763170b1ba288a7fd656dc6a99cb23f.zip
Diffstat (limited to 'src')
-rw-r--r--src/yuzu/configuration/configure_input_player.cpp15
-rw-r--r--src/yuzu/configuration/configure_mouse_advanced.cpp15
2 files changed, 16 insertions, 14 deletions
diff --git a/src/yuzu/configuration/configure_input_player.cpp b/src/yuzu/configuration/configure_input_player.cpp
index 96dec50e2..15ac30f12 100644
--- a/src/yuzu/configuration/configure_input_player.cpp
+++ b/src/yuzu/configuration/configure_input_player.cpp
@@ -541,18 +541,19 @@ void ConfigureInputPlayer::HandleClick(
button->setText(tr("[press key]"));
button->setFocus();
- const auto iter = std::find(button_map.begin(), button_map.end(), button);
- ASSERT(iter != button_map.end());
- const auto index = std::distance(button_map.begin(), iter);
- ASSERT(index < Settings::NativeButton::NumButtons && index >= 0);
+ // Keyboard keys can only be used as button devices
+ want_keyboard_keys = type == InputCommon::Polling::DeviceType::Button;
+ if (want_keyboard_keys) {
+ const auto iter = std::find(button_map.begin(), button_map.end(), button);
+ ASSERT(iter != button_map.end());
+ const auto index = std::distance(button_map.begin(), iter);
+ ASSERT(index < Settings::NativeButton::NumButtons && index >= 0);
+ }
input_setter = new_input_setter;
device_pollers = InputCommon::Polling::GetPollers(type);
- // Keyboard keys can only be used as button devices
- want_keyboard_keys = type == InputCommon::Polling::DeviceType::Button;
-
for (auto& poller : device_pollers) {
poller->Start();
}
diff --git a/src/yuzu/configuration/configure_mouse_advanced.cpp b/src/yuzu/configuration/configure_mouse_advanced.cpp
index 0a4abe34f..e0647ea5b 100644
--- a/src/yuzu/configuration/configure_mouse_advanced.cpp
+++ b/src/yuzu/configuration/configure_mouse_advanced.cpp
@@ -184,18 +184,19 @@ void ConfigureMouseAdvanced::HandleClick(
button->setText(tr("[press key]"));
button->setFocus();
- const auto iter = std::find(button_map.begin(), button_map.end(), button);
- ASSERT(iter != button_map.end());
- const auto index = std::distance(button_map.begin(), iter);
- ASSERT(index < Settings::NativeButton::NumButtons && index >= 0);
+ // Keyboard keys can only be used as button devices
+ want_keyboard_keys = type == InputCommon::Polling::DeviceType::Button;
+ if (want_keyboard_keys) {
+ const auto iter = std::find(button_map.begin(), button_map.end(), button);
+ ASSERT(iter != button_map.end());
+ const auto index = std::distance(button_map.begin(), iter);
+ ASSERT(index < Settings::NativeButton::NumButtons && index >= 0);
+ }
input_setter = new_input_setter;
device_pollers = InputCommon::Polling::GetPollers(type);
- // Keyboard keys can only be used as button devices
- want_keyboard_keys = type == InputCommon::Polling::DeviceType::Button;
-
for (auto& poller : device_pollers) {
poller->Start();
}