diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/citra_qt/bootmanager.cpp | 5 | ||||
| -rw-r--r-- | src/citra_qt/bootmanager.h | 2 | ||||
| -rw-r--r-- | src/citra_qt/main.cpp | 1 | ||||
| -rw-r--r-- | src/input_common/keyboard.cpp | 11 | ||||
| -rw-r--r-- | src/input_common/keyboard.h | 2 |
5 files changed, 18 insertions, 3 deletions
diff --git a/src/citra_qt/bootmanager.cpp b/src/citra_qt/bootmanager.cpp index 28264df9a..bae576d6a 100644 --- a/src/citra_qt/bootmanager.cpp +++ b/src/citra_qt/bootmanager.cpp | |||
| @@ -235,7 +235,10 @@ void GRenderWindow::mouseReleaseEvent(QMouseEvent* event) { | |||
| 235 | motion_emu->EndTilt(); | 235 | motion_emu->EndTilt(); |
| 236 | } | 236 | } |
| 237 | 237 | ||
| 238 | void GRenderWindow::ReloadSetKeymaps() {} | 238 | void GRenderWindow::focusOutEvent(QFocusEvent* event) { |
| 239 | QWidget::focusOutEvent(event); | ||
| 240 | InputCommon::GetKeyboard()->ReleaseAllKeys(); | ||
| 241 | } | ||
| 239 | 242 | ||
| 240 | void GRenderWindow::OnClientAreaResized(unsigned width, unsigned height) { | 243 | void GRenderWindow::OnClientAreaResized(unsigned width, unsigned height) { |
| 241 | NotifyClientAreaSizeChanged(std::make_pair(width, height)); | 244 | NotifyClientAreaSizeChanged(std::make_pair(width, height)); |
diff --git a/src/citra_qt/bootmanager.h b/src/citra_qt/bootmanager.h index 923a5b456..9d39f1af8 100644 --- a/src/citra_qt/bootmanager.h +++ b/src/citra_qt/bootmanager.h | |||
| @@ -128,7 +128,7 @@ public: | |||
| 128 | void mouseMoveEvent(QMouseEvent* event) override; | 128 | void mouseMoveEvent(QMouseEvent* event) override; |
| 129 | void mouseReleaseEvent(QMouseEvent* event) override; | 129 | void mouseReleaseEvent(QMouseEvent* event) override; |
| 130 | 130 | ||
| 131 | void ReloadSetKeymaps(); | 131 | void focusOutEvent(QFocusEvent* event) override; |
| 132 | 132 | ||
| 133 | void OnClientAreaResized(unsigned width, unsigned height); | 133 | void OnClientAreaResized(unsigned width, unsigned height); |
| 134 | 134 | ||
diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index fd51659b9..2723a0217 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp | |||
| @@ -612,7 +612,6 @@ void GMainWindow::OnConfigure() { | |||
| 612 | auto result = configureDialog.exec(); | 612 | auto result = configureDialog.exec(); |
| 613 | if (result == QDialog::Accepted) { | 613 | if (result == QDialog::Accepted) { |
| 614 | configureDialog.applyConfiguration(); | 614 | configureDialog.applyConfiguration(); |
| 615 | render_window->ReloadSetKeymaps(); | ||
| 616 | config->Save(); | 615 | config->Save(); |
| 617 | } | 616 | } |
| 618 | } | 617 | } |
diff --git a/src/input_common/keyboard.cpp b/src/input_common/keyboard.cpp index a8fc01f2e..0f0d10f23 100644 --- a/src/input_common/keyboard.cpp +++ b/src/input_common/keyboard.cpp | |||
| @@ -53,6 +53,13 @@ public: | |||
| 53 | } | 53 | } |
| 54 | } | 54 | } |
| 55 | 55 | ||
| 56 | void ChangeAllKeyStatus(bool pressed) { | ||
| 57 | std::lock_guard<std::mutex> guard(mutex); | ||
| 58 | for (const KeyButtonPair& pair : list) { | ||
| 59 | pair.key_button->status.store(pressed); | ||
| 60 | } | ||
| 61 | } | ||
| 62 | |||
| 56 | private: | 63 | private: |
| 57 | std::mutex mutex; | 64 | std::mutex mutex; |
| 58 | std::list<KeyButtonPair> list; | 65 | std::list<KeyButtonPair> list; |
| @@ -79,4 +86,8 @@ void Keyboard::ReleaseKey(int key_code) { | |||
| 79 | key_button_list->ChangeKeyStatus(key_code, false); | 86 | key_button_list->ChangeKeyStatus(key_code, false); |
| 80 | } | 87 | } |
| 81 | 88 | ||
| 89 | void Keyboard::ReleaseAllKeys() { | ||
| 90 | key_button_list->ChangeAllKeyStatus(false); | ||
| 91 | } | ||
| 92 | |||
| 82 | } // namespace InputCommon | 93 | } // namespace InputCommon |
diff --git a/src/input_common/keyboard.h b/src/input_common/keyboard.h index 76359aa30..861950472 100644 --- a/src/input_common/keyboard.h +++ b/src/input_common/keyboard.h | |||
| @@ -38,6 +38,8 @@ public: | |||
| 38 | */ | 38 | */ |
| 39 | void ReleaseKey(int key_code); | 39 | void ReleaseKey(int key_code); |
| 40 | 40 | ||
| 41 | void ReleaseAllKeys(); | ||
| 42 | |||
| 41 | private: | 43 | private: |
| 42 | std::shared_ptr<KeyButtonList> key_button_list; | 44 | std::shared_ptr<KeyButtonList> key_button_list; |
| 43 | }; | 45 | }; |