summaryrefslogtreecommitdiffstats
path: root/src/core/hid/emulated_console.cpp
diff options
context:
space:
mode:
authorgerman77 <juangerman-13@hotmail.com>2021-11-14 21:09:29 +0100
committerNarr the Reg <juangerman-13@hotmail.com>2021-11-25 03:30:28 +0100
commit654d76e79e84a3384fa503fac9003a5d0a32f28b (patch)
tree7a0d436a55aa73401d7b77bae4870c10ceca16cd /src/core/hid/emulated_console.cpp
parentinput_common: Allow keyboard to be backwards compatible (diff)
downloadyuzu-654d76e79e84a3384fa503fac9003a5d0a32f28b.tar
yuzu-654d76e79e84a3384fa503fac9003a5d0a32f28b.tar.gz
yuzu-654d76e79e84a3384fa503fac9003a5d0a32f28b.tar.bz2
yuzu-654d76e79e84a3384fa503fac9003a5d0a32f28b.tar.lz
yuzu-654d76e79e84a3384fa503fac9003a5d0a32f28b.tar.xz
yuzu-654d76e79e84a3384fa503fac9003a5d0a32f28b.tar.zst
yuzu-654d76e79e84a3384fa503fac9003a5d0a32f28b.zip
Diffstat (limited to '')
-rw-r--r--src/core/hid/emulated_console.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/core/hid/emulated_console.cpp b/src/core/hid/emulated_console.cpp
index 374dd5d41..b224932dc 100644
--- a/src/core/hid/emulated_console.cpp
+++ b/src/core/hid/emulated_console.cpp
@@ -24,7 +24,10 @@ void EmulatedConsole::SetTouchParams() {
std::size_t index = 0;
// Hardcode mouse, touchscreen and cemuhook parameters
- touch_params[index++] = Common::ParamPackage{"engine:mouse,axis_x:10,axis_y:11,button:0"};
+ if (!Settings::values.mouse_enabled) {
+ // We can't use mouse as touch if native mouse is enabled
+ touch_params[index++] = Common::ParamPackage{"engine:mouse,axis_x:10,axis_y:11,button:0"};
+ }
touch_params[index++] = Common::ParamPackage{"engine:touch,axis_x:0,axis_y:1,button:0"};
touch_params[index++] = Common::ParamPackage{"engine:touch,axis_x:2,axis_y:3,button:1"};
touch_params[index++] = Common::ParamPackage{"engine:cemuhookudp,axis_x:0,axis_y:1,button:0"};
@@ -36,6 +39,9 @@ void EmulatedConsole::SetTouchParams() {
// Map the rest of the fingers from touch from button configuration
for (const auto& config_entry : touch_buttons) {
+ if (index >= touch_params.size()) {
+ continue;
+ }
Common::ParamPackage params{config_entry};
Common::ParamPackage touch_button_params;
const int x = params.Get("x", 0);
@@ -49,9 +55,6 @@ void EmulatedConsole::SetTouchParams() {
touch_button_params.Set("touch_id", static_cast<int>(index));
touch_params[index] = touch_button_params;
index++;
- if (index >= touch_params.size()) {
- return;
- }
}
}