summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2020-05-19 21:55:14 +0200
committerGitHub <noreply@github.com>2020-05-19 21:55:14 +0200
commitcf4ee279c6424ada927f74fcc34e013038af7228 (patch)
tree40589b41a0d79f166d6b47c8b5e6726a2ca1a246 /src/core
parentMerge pull request #3665 from bunnei/device-save (diff)
parenthid: Clear keyboard states & fix logic issue (diff)
downloadyuzu-cf4ee279c6424ada927f74fcc34e013038af7228.tar
yuzu-cf4ee279c6424ada927f74fcc34e013038af7228.tar.gz
yuzu-cf4ee279c6424ada927f74fcc34e013038af7228.tar.bz2
yuzu-cf4ee279c6424ada927f74fcc34e013038af7228.tar.lz
yuzu-cf4ee279c6424ada927f74fcc34e013038af7228.tar.xz
yuzu-cf4ee279c6424ada927f74fcc34e013038af7228.tar.zst
yuzu-cf4ee279c6424ada927f74fcc34e013038af7228.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/service/hid/controllers/keyboard.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/core/hle/service/hid/controllers/keyboard.cpp b/src/core/hle/service/hid/controllers/keyboard.cpp
index 358cb9329..9a8d354ba 100644
--- a/src/core/hle/service/hid/controllers/keyboard.cpp
+++ b/src/core/hle/service/hid/controllers/keyboard.cpp
@@ -38,10 +38,11 @@ void Controller_Keyboard::OnUpdate(const Core::Timing::CoreTiming& core_timing,
cur_entry.sampling_number = last_entry.sampling_number + 1;
cur_entry.sampling_number2 = cur_entry.sampling_number;
+ cur_entry.key.fill(0);
+ cur_entry.modifier = 0;
+
for (std::size_t i = 0; i < keyboard_keys.size(); ++i) {
- for (std::size_t k = 0; k < KEYS_PER_BYTE; ++k) {
- cur_entry.key[i / KEYS_PER_BYTE] |= (keyboard_keys[i]->GetStatus() << k);
- }
+ cur_entry.key[i / KEYS_PER_BYTE] |= (keyboard_keys[i]->GetStatus() << (i % KEYS_PER_BYTE));
}
for (std::size_t i = 0; i < keyboard_mods.size(); ++i) {