diff options
Diffstat (limited to 'src/input_common/keyboard.cpp')
| -rw-r--r-- | src/input_common/keyboard.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/input_common/keyboard.cpp b/src/input_common/keyboard.cpp index 078374be5..24a6f7a33 100644 --- a/src/input_common/keyboard.cpp +++ b/src/input_common/keyboard.cpp | |||
| @@ -49,8 +49,9 @@ public: | |||
| 49 | void ChangeKeyStatus(int key_code, bool pressed) { | 49 | void ChangeKeyStatus(int key_code, bool pressed) { |
| 50 | std::lock_guard guard{mutex}; | 50 | std::lock_guard guard{mutex}; |
| 51 | for (const KeyButtonPair& pair : list) { | 51 | for (const KeyButtonPair& pair : list) { |
| 52 | if (pair.key_code == key_code) | 52 | if (pair.key_code == key_code) { |
| 53 | pair.key_button->status.store(pressed); | 53 | pair.key_button->status.store(pressed); |
| 54 | } | ||
| 54 | } | 55 | } |
| 55 | } | 56 | } |
| 56 | 57 | ||
| @@ -73,10 +74,10 @@ KeyButton::~KeyButton() { | |||
| 73 | } | 74 | } |
| 74 | 75 | ||
| 75 | std::unique_ptr<Input::ButtonDevice> Keyboard::Create(const Common::ParamPackage& params) { | 76 | std::unique_ptr<Input::ButtonDevice> Keyboard::Create(const Common::ParamPackage& params) { |
| 76 | int key_code = params.Get("code", 0); | 77 | const int key_code = params.Get("code", 0); |
| 77 | std::unique_ptr<KeyButton> button = std::make_unique<KeyButton>(key_button_list); | 78 | std::unique_ptr<KeyButton> button = std::make_unique<KeyButton>(key_button_list); |
| 78 | key_button_list->AddKeyButton(key_code, button.get()); | 79 | key_button_list->AddKeyButton(key_code, button.get()); |
| 79 | return std::move(button); | 80 | return button; |
| 80 | } | 81 | } |
| 81 | 82 | ||
| 82 | void Keyboard::PressKey(int key_code) { | 83 | void Keyboard::PressKey(int key_code) { |