From 371f9bcb844509d37708555d07cad0ef4f1630db Mon Sep 17 00:00:00 2001 From: pineappleEA Date: Mon, 3 May 2021 22:48:40 +0200 Subject: [PATCH] early-access version 1653 --- README.md | 2 +- src/input_common/mouse/mouse_input.cpp | 9 +++++++++ src/input_common/mouse/mouse_input.h | 8 +++++++- src/yuzu/bootmanager.cpp | 2 ++ 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 09a0ecccc..b2759aafe 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ yuzu emulator early access ============= -This is the source code for early-access 1652. +This is the source code for early-access 1653. ## Legal Notice diff --git a/src/input_common/mouse/mouse_input.cpp b/src/input_common/mouse/mouse_input.cpp index fff1c6b45..a335e6da1 100755 --- a/src/input_common/mouse/mouse_input.cpp +++ b/src/input_common/mouse/mouse_input.cpp @@ -143,6 +143,15 @@ void Mouse::ReleaseButton(MouseButton button_) { mouse_info[button_index].data.axis = {0, 0}; } +void Mouse::ReleaseAllButtons() { + buttons = 0; + for (auto& info : mouse_info) { + info.tilt_speed = 0; + info.data.pressed = false; + info.data.axis = {0, 0}; + } +} + void Mouse::BeginConfiguration() { buttons = 0; last_button = MouseButton::Undefined; diff --git a/src/input_common/mouse/mouse_input.h b/src/input_common/mouse/mouse_input.h index 750d9b011..5a971ad67 100755 --- a/src/input_common/mouse/mouse_input.h +++ b/src/input_common/mouse/mouse_input.h @@ -65,10 +65,16 @@ public: void MouseMove(int x, int y, int center_x, int center_y); /** - * Signals that a motion sensor tilt has ended. + * Signals that a button is released. + * @param button_ the button pressed */ void ReleaseButton(MouseButton button_); + /** + * Signals that all buttons are released + */ + void ReleaseAllButtons(); + [[nodiscard]] bool ToggleButton(std::size_t button_); [[nodiscard]] bool UnlockButton(std::size_t button_); diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp index f9d3368c5..86495803e 100755 --- a/src/yuzu/bootmanager.cpp +++ b/src/yuzu/bootmanager.cpp @@ -539,6 +539,8 @@ bool GRenderWindow::event(QEvent* event) { void GRenderWindow::focusOutEvent(QFocusEvent* event) { QWidget::focusOutEvent(event); input_subsystem->GetKeyboard()->ReleaseAllKeys(); + input_subsystem->GetMouse()->ReleaseAllButtons(); + this->TouchReleased(0); } void GRenderWindow::resizeEvent(QResizeEvent* event) {