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/mouse.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/mouse.h | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/src/core/hle/service/hid/controllers/mouse.h b/src/core/hle/service/hid/controllers/mouse.h index 357ab7107..3b432a36e 100644 --- a/src/core/hle/service/hid/controllers/mouse.h +++ b/src/core/hle/service/hid/controllers/mouse.h @@ -5,6 +5,7 @@ #pragma once #include <array> +#include "common/bit_field.h" #include "common/common_types.h" #include "common/swap.h" #include "core/frontend/input.h" @@ -30,6 +31,27 @@ public: void OnLoadInputDevices() override; private: + struct Buttons { + union { + u32_le raw{}; + BitField<0, 1, u32> left; + BitField<1, 1, u32> right; + BitField<2, 1, u32> middle; + BitField<3, 1, u32> forward; + BitField<4, 1, u32> back; + }; + }; + static_assert(sizeof(Buttons) == 0x4, "Buttons is an invalid size"); + + struct Attributes { + union { + u32_le raw{}; + BitField<0, 1, u32> transferable; + BitField<1, 1, u32> is_connected; + }; + }; + static_assert(sizeof(Attributes) == 0x4, "Attributes is an invalid size"); + struct MouseState { s64_le sampling_number; s64_le sampling_number2; @@ -39,8 +61,8 @@ private: s32_le delta_y; s32_le mouse_wheel_x; s32_le mouse_wheel_y; - s32_le button; - s32_le attribute; + Buttons button; + Attributes attribute; }; static_assert(sizeof(MouseState) == 0x30, "MouseState is an invalid size"); |