diff options
author | bunnei <bunneidev@gmail.com> | 2021-02-06 11:40:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-06 11:40:11 +0100 |
commit | 61bf850f3dfd0b44aa5d56f6f3147d7a1fa47353 (patch) | |
tree | 08709ce3ce8890b37353ff747f4ce4401fcb1fd1 /src/core/hle/service/hid/controllers/keyboard.h | |
parent | Merge pull request #5862 from bunnei/kevent (diff) | |
parent | Add footer types and address comments (diff) | |
download | yuzu-61bf850f3dfd0b44aa5d56f6f3147d7a1fa47353.tar yuzu-61bf850f3dfd0b44aa5d56f6f3147d7a1fa47353.tar.gz yuzu-61bf850f3dfd0b44aa5d56f6f3147d7a1fa47353.tar.bz2 yuzu-61bf850f3dfd0b44aa5d56f6f3147d7a1fa47353.tar.lz yuzu-61bf850f3dfd0b44aa5d56f6f3147d7a1fa47353.tar.xz yuzu-61bf850f3dfd0b44aa5d56f6f3147d7a1fa47353.tar.zst yuzu-61bf850f3dfd0b44aa5d56f6f3147d7a1fa47353.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/hid/controllers/keyboard.h | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/core/hle/service/hid/controllers/keyboard.h b/src/core/hle/service/hid/controllers/keyboard.h index f3eef5936..b5b281752 100644 --- a/src/core/hle/service/hid/controllers/keyboard.h +++ b/src/core/hle/service/hid/controllers/keyboard.h @@ -5,6 +5,7 @@ #pragma once #include <array> +#include "common/bit_field.h" #include "common/common_funcs.h" #include "common/common_types.h" #include "common/swap.h" @@ -31,12 +32,28 @@ public: void OnLoadInputDevices() override; private: + struct Modifiers { + union { + u32_le raw{}; + BitField<0, 1, u32> control; + BitField<1, 1, u32> shift; + BitField<2, 1, u32> left_alt; + BitField<3, 1, u32> right_alt; + BitField<4, 1, u32> gui; + BitField<8, 1, u32> caps_lock; + BitField<9, 1, u32> scroll_lock; + BitField<10, 1, u32> num_lock; + BitField<11, 1, u32> katakana; + BitField<12, 1, u32> hiragana; + }; + }; + static_assert(sizeof(Modifiers) == 0x4, "Modifiers is an invalid size"); + struct KeyboardState { s64_le sampling_number; s64_le sampling_number2; - s32_le modifier; - s32_le attribute; + Modifiers modifier; std::array<u8, 32> key; }; static_assert(sizeof(KeyboardState) == 0x38, "KeyboardState is an invalid size"); |