summaryrefslogtreecommitdiffstats
path: root/src/input_common/keyboard.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2020-10-16 05:59:34 +0200
committerGitHub <noreply@github.com>2020-10-16 05:59:34 +0200
commit64f967fd4958abb5a02191a81e91fc8b33bcf4c5 (patch)
tree97a73da4871f006b39eafca3a881ae2ea42f206a /src/input_common/keyboard.cpp
parentMerge pull request #4784 from bunnei/cancelbuffer (diff)
parentinput_common/CMakeLists: Make some warnings errors (diff)
downloadyuzu-64f967fd4958abb5a02191a81e91fc8b33bcf4c5.tar
yuzu-64f967fd4958abb5a02191a81e91fc8b33bcf4c5.tar.gz
yuzu-64f967fd4958abb5a02191a81e91fc8b33bcf4c5.tar.bz2
yuzu-64f967fd4958abb5a02191a81e91fc8b33bcf4c5.tar.lz
yuzu-64f967fd4958abb5a02191a81e91fc8b33bcf4c5.tar.xz
yuzu-64f967fd4958abb5a02191a81e91fc8b33bcf4c5.tar.zst
yuzu-64f967fd4958abb5a02191a81e91fc8b33bcf4c5.zip
Diffstat (limited to '')
-rw-r--r--src/input_common/keyboard.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/input_common/keyboard.cpp b/src/input_common/keyboard.cpp
index afb8e6612..24a6f7a33 100644
--- a/src/input_common/keyboard.cpp
+++ b/src/input_common/keyboard.cpp
@@ -49,8 +49,9 @@ public:
void ChangeKeyStatus(int key_code, bool pressed) {
std::lock_guard guard{mutex};
for (const KeyButtonPair& pair : list) {
- if (pair.key_code == key_code)
+ if (pair.key_code == key_code) {
pair.key_button->status.store(pressed);
+ }
}
}
@@ -73,7 +74,7 @@ KeyButton::~KeyButton() {
}
std::unique_ptr<Input::ButtonDevice> Keyboard::Create(const Common::ParamPackage& params) {
- int key_code = params.Get("code", 0);
+ const int key_code = params.Get("code", 0);
std::unique_ptr<KeyButton> button = std::make_unique<KeyButton>(key_button_list);
key_button_list->AddKeyButton(key_code, button.get());
return button;