diff options
author | Narr the Reg <juangerman-13@hotmail.com> | 2023-01-11 01:18:30 +0100 |
---|---|---|
committer | Narr the Reg <juangerman-13@hotmail.com> | 2023-01-11 01:20:58 +0100 |
commit | 87b02f78e17b40b08f8efcb6a9fd8cf4dab976aa (patch) | |
tree | 8ab2d9da46fd3c8fcf0bb4bcc0d16a89c2633dde | |
parent | Merge pull request #9583 from FernandoS27/fuck-ogl-already (diff) | |
download | yuzu-87b02f78e17b40b08f8efcb6a9fd8cf4dab976aa.tar yuzu-87b02f78e17b40b08f8efcb6a9fd8cf4dab976aa.tar.gz yuzu-87b02f78e17b40b08f8efcb6a9fd8cf4dab976aa.tar.bz2 yuzu-87b02f78e17b40b08f8efcb6a9fd8cf4dab976aa.tar.lz yuzu-87b02f78e17b40b08f8efcb6a9fd8cf4dab976aa.tar.xz yuzu-87b02f78e17b40b08f8efcb6a9fd8cf4dab976aa.tar.zst yuzu-87b02f78e17b40b08f8efcb6a9fd8cf4dab976aa.zip |
-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) { break; case EngineInputType::Analog: // Ignore mouse axis when mapping buttons - if (data.engine == "mouse") { + if (data.engine == "mouse" && data.index != 4) { return; } 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) { input_subsystem->GetMouse()->PressButton(0, 0, 0, 0, button); } +void ConfigureInputPlayer::wheelEvent(QWheelEvent* event) { + const int x = event->angleDelta().x(); + const int y = event->angleDelta().y(); + input_subsystem->GetMouse()->MouseWheelChange(x, y); +} + void ConfigureInputPlayer::keyPressEvent(QKeyEvent* event) { if (!input_setter || !event) { 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: /// Handle mouse button press events. void mousePressEvent(QMouseEvent* event) override; + /// Handle mouse wheel move events. + void wheelEvent(QWheelEvent* event) override; + /// Handle key press events. void keyPressEvent(QKeyEvent* event) override; |