CommonLibSSE (Parapets fork)
BSWin32GamepadDevice.h
Go to the documentation of this file.
1 #pragma once
2 
4 
5 namespace RE
6 {
8  {
9  public:
10  inline static constexpr auto RTTI = RTTI_BSWin32GamepadDevice;
11 
12  struct Keys
13  {
14  enum Key : std::uint32_t
15  {
16  kUp = 0x0001,
17  kDown = 0x0002,
18  kLeft = 0x0004,
19  kRight = 0x0008,
20  kStart = 0x0010,
21  kBack = 0x0020,
22  kLeftThumb = 0x0040,
23  kRightThumb = 0x0080,
24  kLeftShoulder = 0x0100,
25  kRightShoulder = 0x0200,
26 
27  kA = 0x1000,
28  kB = 0x2000,
29  kX = 0x4000,
30  kY = 0x8000,
31 
32  kLeftTrigger = 0x0009,
33  kRightTrigger = 0x000A
34  };
35  };
36  using Key = Keys::Key;
37 
38  struct InputState
39  {
40  public:
42  float leftTrigger; // 10
43  float rightTrigger; // 14
44  float thumbLX; // 18
45  float thumbLY; // 1C
46  float thumbRX; // 20
47  float thumbRY; // 24
48  };
49  static_assert(sizeof(InputState) == 0x28);
50 
51  ~BSWin32GamepadDevice() override; // 00
52 
53  // override (BSPCGamepadDeviceDelegate)
54  void Initialize() override; // 01
55  void Poll(float a_timeDelta) override; // 02
56  void Shutdown() override; // 03 - { return; }
57  void ClearInputState() override; // 08 - { std::memset(&unk0D8, 0, 0x50); }
58  void SetVibration(float a_largeMotor, float a_smallMotor) override; // 09 - { return; }
59 
60  // members
63  };
64  static_assert(sizeof(BSWin32GamepadDevice) == 0x128);
65 }
Definition: BSPCGamepadDeviceDelegate.h:10
Definition: BSWin32GamepadDevice.h:8
void Poll(float a_timeDelta) override
~BSWin32GamepadDevice() override
static constexpr auto RTTI
Definition: BSWin32GamepadDevice.h:10
InputState currentState
Definition: BSWin32GamepadDevice.h:62
void Shutdown() override
void ClearInputState() override
InputState previousState
Definition: BSWin32GamepadDevice.h:61
void SetVibration(float a_largeMotor, float a_smallMotor) override
void Initialize() override
Definition: AbsorbEffect.h:6
constexpr REL::ID RTTI_BSWin32GamepadDevice
Definition: Offsets_RTTI.h:3643
Definition: BSWin32GamepadDevice.h:39
float thumbLX
Definition: BSWin32GamepadDevice.h:44
float leftTrigger
Definition: BSWin32GamepadDevice.h:42
float thumbRX
Definition: BSWin32GamepadDevice.h:46
float rightTrigger
Definition: BSWin32GamepadDevice.h:43
float thumbRY
Definition: BSWin32GamepadDevice.h:47
float thumbLY
Definition: BSWin32GamepadDevice.h:45
XInput::XINPUT_STATE xinputState
Definition: BSWin32GamepadDevice.h:41
Definition: BSWin32GamepadDevice.h:13
Key
Definition: BSWin32GamepadDevice.h:15
@ kUp
Definition: BSWin32GamepadDevice.h:16
@ kRightThumb
Definition: BSWin32GamepadDevice.h:23
@ kRight
Definition: BSWin32GamepadDevice.h:19
@ kB
Definition: BSWin32GamepadDevice.h:28
@ kLeftThumb
Definition: BSWin32GamepadDevice.h:22
@ kDown
Definition: BSWin32GamepadDevice.h:17
@ kA
Definition: BSWin32GamepadDevice.h:27
@ kLeft
Definition: BSWin32GamepadDevice.h:18
@ kBack
Definition: BSWin32GamepadDevice.h:21
@ kY
Definition: BSWin32GamepadDevice.h:30
@ kRightTrigger
Definition: BSWin32GamepadDevice.h:33
@ kLeftTrigger
Definition: BSWin32GamepadDevice.h:32
@ kRightShoulder
Definition: BSWin32GamepadDevice.h:25
@ kX
Definition: BSWin32GamepadDevice.h:29
@ kStart
Definition: BSWin32GamepadDevice.h:20
@ kLeftShoulder
Definition: BSWin32GamepadDevice.h:24
Definition: WinAPI.h:374