diff options
| author | 2021-05-03 12:50:19 -0700 | |
|---|---|---|
| committer | 2021-05-03 12:50:19 -0700 | |
| commit | 898aa5fb6612e8c009fa65224ef9ea404448db59 (patch) | |
| tree | 73c9803fabc9b170b11bff6a73e9b4030afbbce6 /src/input_common/mouse/mouse_input.cpp | |
| parent | Merge pull request #6277 from german77/touchsetting2 (diff) | |
| parent | input_common: Release mouse buttons on out of focus (diff) | |
| download | yuzu-898aa5fb6612e8c009fa65224ef9ea404448db59.tar.gz yuzu-898aa5fb6612e8c009fa65224ef9ea404448db59.tar.xz yuzu-898aa5fb6612e8c009fa65224ef9ea404448db59.zip | |
Merge pull request #6275 from german77/mousefocus
input_common: Release mouse buttons on out of focus
Diffstat (limited to 'src/input_common/mouse/mouse_input.cpp')
| -rw-r--r-- | src/input_common/mouse/mouse_input.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/input_common/mouse/mouse_input.cpp b/src/input_common/mouse/mouse_input.cpp index fff1c6b45..a335e6da1 100644 --- 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_) { | |||
| 143 | mouse_info[button_index].data.axis = {0, 0}; | 143 | mouse_info[button_index].data.axis = {0, 0}; |
| 144 | } | 144 | } |
| 145 | 145 | ||
| 146 | void Mouse::ReleaseAllButtons() { | ||
| 147 | buttons = 0; | ||
| 148 | for (auto& info : mouse_info) { | ||
| 149 | info.tilt_speed = 0; | ||
| 150 | info.data.pressed = false; | ||
| 151 | info.data.axis = {0, 0}; | ||
| 152 | } | ||
| 153 | } | ||
| 154 | |||
| 146 | void Mouse::BeginConfiguration() { | 155 | void Mouse::BeginConfiguration() { |
| 147 | buttons = 0; | 156 | buttons = 0; |
| 148 | last_button = MouseButton::Undefined; | 157 | last_button = MouseButton::Undefined; |