diff options
| author | 2023-01-10 17:32:58 -0800 | |
|---|---|---|
| committer | 2023-01-10 17:32:58 -0800 | |
| commit | 0e8f98a441400d0dc87425d4c2c26e71e995bdcb (patch) | |
| tree | c61f3004ff0b01b88b4990436ddb2abe9119dce1 | |
| parent | Merge pull request #9596 from liamwhite/mvk (diff) | |
| parent | yuzu: Read mouse wheel input (diff) | |
| download | yuzu-0e8f98a441400d0dc87425d4c2c26e71e995bdcb.tar.gz yuzu-0e8f98a441400d0dc87425d4c2c26e71e995bdcb.tar.xz yuzu-0e8f98a441400d0dc87425d4c2c26e71e995bdcb.zip | |
Merge pull request #9605 from german77/mouse_mapping
yuzu: Read mouse scroll
| -rw-r--r-- | src/input_common/input_mapping.cpp | 2 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_input_player.cpp | 6 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_input_player.h | 3 |
3 files changed, 10 insertions, 1 deletions
diff --git a/src/input_common/input_mapping.cpp b/src/input_common/input_mapping.cpp index edd5287c1..d6e49d2c5 100644 --- a/src/input_common/input_mapping.cpp +++ b/src/input_common/input_mapping.cpp | |||
| @@ -76,7 +76,7 @@ void MappingFactory::RegisterButton(const MappingData& data) { | |||
| 76 | break; | 76 | break; |
| 77 | case EngineInputType::Analog: | 77 | case EngineInputType::Analog: |
| 78 | // Ignore mouse axis when mapping buttons | 78 | // Ignore mouse axis when mapping buttons |
| 79 | if (data.engine == "mouse") { | 79 | if (data.engine == "mouse" && data.index != 4) { |
| 80 | return; | 80 | return; |
| 81 | } | 81 | } |
| 82 | new_input.Set("axis", data.index); | 82 | new_input.Set("axis", data.index); |
diff --git a/src/yuzu/configuration/configure_input_player.cpp b/src/yuzu/configuration/configure_input_player.cpp index 183cbe562..c40d980c9 100644 --- a/src/yuzu/configuration/configure_input_player.cpp +++ b/src/yuzu/configuration/configure_input_player.cpp | |||
| @@ -1466,6 +1466,12 @@ void ConfigureInputPlayer::mousePressEvent(QMouseEvent* event) { | |||
| 1466 | input_subsystem->GetMouse()->PressButton(0, 0, 0, 0, button); | 1466 | input_subsystem->GetMouse()->PressButton(0, 0, 0, 0, button); |
| 1467 | } | 1467 | } |
| 1468 | 1468 | ||
| 1469 | void ConfigureInputPlayer::wheelEvent(QWheelEvent* event) { | ||
| 1470 | const int x = event->angleDelta().x(); | ||
| 1471 | const int y = event->angleDelta().y(); | ||
| 1472 | input_subsystem->GetMouse()->MouseWheelChange(x, y); | ||
| 1473 | } | ||
| 1474 | |||
| 1469 | void ConfigureInputPlayer::keyPressEvent(QKeyEvent* event) { | 1475 | void ConfigureInputPlayer::keyPressEvent(QKeyEvent* event) { |
| 1470 | if (!input_setter || !event) { | 1476 | if (!input_setter || !event) { |
| 1471 | return; | 1477 | return; |
diff --git a/src/yuzu/configuration/configure_input_player.h b/src/yuzu/configuration/configure_input_player.h index 6d1876f2b..99a9c875d 100644 --- a/src/yuzu/configuration/configure_input_player.h +++ b/src/yuzu/configuration/configure_input_player.h | |||
| @@ -116,6 +116,9 @@ private: | |||
| 116 | /// Handle mouse button press events. | 116 | /// Handle mouse button press events. |
| 117 | void mousePressEvent(QMouseEvent* event) override; | 117 | void mousePressEvent(QMouseEvent* event) override; |
| 118 | 118 | ||
| 119 | /// Handle mouse wheel move events. | ||
| 120 | void wheelEvent(QWheelEvent* event) override; | ||
| 121 | |||
| 119 | /// Handle key press events. | 122 | /// Handle key press events. |
| 120 | void keyPressEvent(QKeyEvent* event) override; | 123 | void keyPressEvent(QKeyEvent* event) override; |
| 121 | 124 | ||