From 0e2edbb0d2e46311d684c6f77e54db2d1e72815c Mon Sep 17 00:00:00 2001 From: Vitor Kiguchi Date: Mon, 5 Apr 2021 19:38:54 -0300 Subject: [PATCH 1/5] Account for analog buttons when checking for used buttons circle mod and analog_from_buttons weren't being accounted for. --- src/citra_qt/configuration/configure_input.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/citra_qt/configuration/configure_input.cpp b/src/citra_qt/configuration/configure_input.cpp index c1ce931d6..d46ac5c1e 100644 --- a/src/citra_qt/configuration/configure_input.cpp +++ b/src/citra_qt/configuration/configure_input.cpp @@ -350,6 +350,17 @@ QList ConfigureInput::GetUsedKeyboardKeys() { list << QKeySequence(button_param.Get("code", 0)); } } + + for (int analog_id = 0; analog_id < Settings::NativeAnalog::NumAnalogs; analog_id++) { + auto analog_param = analogs_param[analog_id]; + if (analog_param.Get("engine", "") == "analog_from_button") { + for (int sub_button_id = 0; sub_button_id < ANALOG_SUB_BUTTONS_NUM; sub_button_id++) { + auto sub_button = Common::ParamPackage{analog_param.Get(analog_sub_buttons[sub_button_id], "")}; + list << QKeySequence(sub_button.Get("code", 0)); + } + } + } + return list; } From 3cc559f865c924f78e6eec707dd9c00430192e38 Mon Sep 17 00:00:00 2001 From: Vitor Kiguchi Date: Mon, 5 Apr 2021 19:52:27 -0300 Subject: [PATCH 2/5] clang format --- src/citra_qt/configuration/configure_input.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/citra_qt/configuration/configure_input.cpp b/src/citra_qt/configuration/configure_input.cpp index d46ac5c1e..17562448c 100644 --- a/src/citra_qt/configuration/configure_input.cpp +++ b/src/citra_qt/configuration/configure_input.cpp @@ -355,7 +355,8 @@ QList ConfigureInput::GetUsedKeyboardKeys() { auto analog_param = analogs_param[analog_id]; if (analog_param.Get("engine", "") == "analog_from_button") { for (int sub_button_id = 0; sub_button_id < ANALOG_SUB_BUTTONS_NUM; sub_button_id++) { - auto sub_button = Common::ParamPackage{analog_param.Get(analog_sub_buttons[sub_button_id], "")}; + auto sub_button = + Common::ParamPackage{analog_param.Get(analog_sub_buttons[sub_button_id], "")}; list << QKeySequence(sub_button.Get("code", 0)); } } From 39680264b4af246db8bacc330049c3523bd00985 Mon Sep 17 00:00:00 2001 From: Vitor K Date: Tue, 6 Apr 2021 19:02:02 -0300 Subject: [PATCH 3/5] citra_qt/configure_input: use pre-increment instead of post-increment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Johel Ernesto Guerrero Peña --- src/citra_qt/configuration/configure_input.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/citra_qt/configuration/configure_input.cpp b/src/citra_qt/configuration/configure_input.cpp index 17562448c..b03aeb632 100644 --- a/src/citra_qt/configuration/configure_input.cpp +++ b/src/citra_qt/configuration/configure_input.cpp @@ -351,10 +351,10 @@ QList ConfigureInput::GetUsedKeyboardKeys() { } } - for (int analog_id = 0; analog_id < Settings::NativeAnalog::NumAnalogs; analog_id++) { + for (int analog_id = 0; analog_id < Settings::NativeAnalog::NumAnalogs; ++analog_id) { auto analog_param = analogs_param[analog_id]; if (analog_param.Get("engine", "") == "analog_from_button") { - for (int sub_button_id = 0; sub_button_id < ANALOG_SUB_BUTTONS_NUM; sub_button_id++) { + for (int sub_button_id = 0; sub_button_id < ANALOG_SUB_BUTTONS_NUM; ++sub_button_id) { auto sub_button = Common::ParamPackage{analog_param.Get(analog_sub_buttons[sub_button_id], "")}; list << QKeySequence(sub_button.Get("code", 0)); From 95383a3d14e558afd905eb8fa0c618176a6dcf4a Mon Sep 17 00:00:00 2001 From: bunnei Date: Sat, 8 Jan 2022 02:02:03 -0800 Subject: [PATCH 4/5] Update src/citra_qt/configuration/configure_input.cpp Co-authored-by: Pengfei Zhu --- src/citra_qt/configuration/configure_input.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/citra_qt/configuration/configure_input.cpp b/src/citra_qt/configuration/configure_input.cpp index b03aeb632..bfc3cb542 100644 --- a/src/citra_qt/configuration/configure_input.cpp +++ b/src/citra_qt/configuration/configure_input.cpp @@ -355,8 +355,7 @@ QList ConfigureInput::GetUsedKeyboardKeys() { auto analog_param = analogs_param[analog_id]; if (analog_param.Get("engine", "") == "analog_from_button") { for (int sub_button_id = 0; sub_button_id < ANALOG_SUB_BUTTONS_NUM; ++sub_button_id) { - auto sub_button = - Common::ParamPackage{analog_param.Get(analog_sub_buttons[sub_button_id], "")}; + const Common::ParamPackage sub_button{analog_param.Get(analog_sub_buttons[sub_button_id], "")}; list << QKeySequence(sub_button.Get("code", 0)); } } From 80fdc3e7c848e358af0470d99ed7c28e0b6899d0 Mon Sep 17 00:00:00 2001 From: Vitor Kiguchi Date: Sat, 8 Jan 2022 12:43:46 +0100 Subject: [PATCH 5/5] clang format --- src/citra_qt/configuration/configure_input.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/citra_qt/configuration/configure_input.cpp b/src/citra_qt/configuration/configure_input.cpp index bfc3cb542..6474fd905 100644 --- a/src/citra_qt/configuration/configure_input.cpp +++ b/src/citra_qt/configuration/configure_input.cpp @@ -355,7 +355,8 @@ QList ConfigureInput::GetUsedKeyboardKeys() { auto analog_param = analogs_param[analog_id]; if (analog_param.Get("engine", "") == "analog_from_button") { for (int sub_button_id = 0; sub_button_id < ANALOG_SUB_BUTTONS_NUM; ++sub_button_id) { - const Common::ParamPackage sub_button{analog_param.Get(analog_sub_buttons[sub_button_id], "")}; + const Common::ParamPackage sub_button{ + analog_param.Get(analog_sub_buttons[sub_button_id], "")}; list << QKeySequence(sub_button.Get("code", 0)); } }