summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/hid/controllers/mouse.h
diff options
context:
space:
mode:
authorgerman <german@thesoftwareartisans.com>2021-01-10 18:37:19 +0100
committergerman <german@thesoftwareartisans.com>2021-02-04 03:17:08 +0100
commitf30ef987615729f5a3b8eab524ce5680369057e9 (patch)
tree665cfd2d8191212f80b5d6bdc3bbe6aa39de8385 /src/core/hle/service/hid/controllers/mouse.h
parentMerge pull request #5863 from ogniK5377/disable-reverb (diff)
downloadyuzu-f30ef987615729f5a3b8eab524ce5680369057e9.tar
yuzu-f30ef987615729f5a3b8eab524ce5680369057e9.tar.gz
yuzu-f30ef987615729f5a3b8eab524ce5680369057e9.tar.bz2
yuzu-f30ef987615729f5a3b8eab524ce5680369057e9.tar.lz
yuzu-f30ef987615729f5a3b8eab524ce5680369057e9.tar.xz
yuzu-f30ef987615729f5a3b8eab524ce5680369057e9.tar.zst
yuzu-f30ef987615729f5a3b8eab524ce5680369057e9.zip
Diffstat (limited to 'src/core/hle/service/hid/controllers/mouse.h')
-rw-r--r--src/core/hle/service/hid/controllers/mouse.h26
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..2c8ebe1d5 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 {
+ s32_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 {
+ s32_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");