diff options
| author | 2021-11-14 14:09:29 -0600 | |
|---|---|---|
| committer | 2021-11-24 20:30:28 -0600 | |
| commit | 654d76e79e84a3384fa503fac9003a5d0a32f28b (patch) | |
| tree | 7a0d436a55aa73401d7b77bae4870c10ceca16cd /src/core/hid/emulated_console.cpp | |
| parent | input_common: Allow keyboard to be backwards compatible (diff) | |
| download | yuzu-654d76e79e84a3384fa503fac9003a5d0a32f28b.tar.gz yuzu-654d76e79e84a3384fa503fac9003a5d0a32f28b.tar.xz yuzu-654d76e79e84a3384fa503fac9003a5d0a32f28b.zip | |
core/hid: Fully implement native mouse
Diffstat (limited to 'src/core/hid/emulated_console.cpp')
| -rw-r--r-- | src/core/hid/emulated_console.cpp | 11 |
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() { | |||
| 24 | std::size_t index = 0; | 24 | std::size_t index = 0; |
| 25 | 25 | ||
| 26 | // Hardcode mouse, touchscreen and cemuhook parameters | 26 | // Hardcode mouse, touchscreen and cemuhook parameters |
| 27 | touch_params[index++] = Common::ParamPackage{"engine:mouse,axis_x:10,axis_y:11,button:0"}; | 27 | if (!Settings::values.mouse_enabled) { |
| 28 | // We can't use mouse as touch if native mouse is enabled | ||
| 29 | touch_params[index++] = Common::ParamPackage{"engine:mouse,axis_x:10,axis_y:11,button:0"}; | ||
| 30 | } | ||
| 28 | touch_params[index++] = Common::ParamPackage{"engine:touch,axis_x:0,axis_y:1,button:0"}; | 31 | touch_params[index++] = Common::ParamPackage{"engine:touch,axis_x:0,axis_y:1,button:0"}; |
| 29 | touch_params[index++] = Common::ParamPackage{"engine:touch,axis_x:2,axis_y:3,button:1"}; | 32 | touch_params[index++] = Common::ParamPackage{"engine:touch,axis_x:2,axis_y:3,button:1"}; |
| 30 | touch_params[index++] = Common::ParamPackage{"engine:cemuhookudp,axis_x:0,axis_y:1,button:0"}; | 33 | touch_params[index++] = Common::ParamPackage{"engine:cemuhookudp,axis_x:0,axis_y:1,button:0"}; |
| @@ -36,6 +39,9 @@ void EmulatedConsole::SetTouchParams() { | |||
| 36 | 39 | ||
| 37 | // Map the rest of the fingers from touch from button configuration | 40 | // Map the rest of the fingers from touch from button configuration |
| 38 | for (const auto& config_entry : touch_buttons) { | 41 | for (const auto& config_entry : touch_buttons) { |
| 42 | if (index >= touch_params.size()) { | ||
| 43 | continue; | ||
| 44 | } | ||
| 39 | Common::ParamPackage params{config_entry}; | 45 | Common::ParamPackage params{config_entry}; |
| 40 | Common::ParamPackage touch_button_params; | 46 | Common::ParamPackage touch_button_params; |
| 41 | const int x = params.Get("x", 0); | 47 | const int x = params.Get("x", 0); |
| @@ -49,9 +55,6 @@ void EmulatedConsole::SetTouchParams() { | |||
| 49 | touch_button_params.Set("touch_id", static_cast<int>(index)); | 55 | touch_button_params.Set("touch_id", static_cast<int>(index)); |
| 50 | touch_params[index] = touch_button_params; | 56 | touch_params[index] = touch_button_params; |
| 51 | index++; | 57 | index++; |
| 52 | if (index >= touch_params.size()) { | ||
| 53 | return; | ||
| 54 | } | ||
| 55 | } | 58 | } |
| 56 | } | 59 | } |
| 57 | 60 | ||