CommonLibSSE (Parapets fork)
ThumbstickEvent.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/I/IDEvent.h"
4 
5 namespace RE
6 {
7  class ThumbstickEvent : public IDEvent
8  {
9  public:
10  inline static constexpr auto RTTI = RTTI_ThumbstickEvent;
11 
12  struct InputTypes
13  {
14  enum InputType : std::uint32_t
15  {
17  kRightThumbstick = 0x0C
18  };
19  };
21 
22  void Init(InputType a_id, float a_xValue, float a_yValue)
23  {
24  Init(a_id, INPUT_DEVICE::kGamepad, a_xValue, a_yValue, ""sv);
25  }
26 
27  void Init(InputType a_id, INPUT_DEVICE a_device, float a_xValue, float a_yValue)
28  {
29  Init(a_id, a_device, a_xValue, a_yValue, ""sv);
30  }
31 
32  void Init(InputType a_id, INPUT_DEVICE a_device, float a_xValue, float a_yValue, const RE::BSFixedString& a_userEvent)
33  {
34  xValue = a_xValue;
35  yValue = a_yValue;
36  device = a_device;
37  idCode = a_id;
38  userEvent = a_userEvent;
39  }
40 
41  [[nodiscard]] bool IsLeft() const;
42  [[nodiscard]] bool IsRight() const;
43 
44  // members
45  float xValue; // 28
46  float yValue; // 2C
47  };
48  static_assert(sizeof(ThumbstickEvent) == 0x30);
49 }
Definition: IDEvent.h:9
std::uint32_t idCode
Definition: IDEvent.h:23
BSFixedString userEvent
Definition: IDEvent.h:22
stl::enumeration< INPUT_DEVICE, std::uint32_t > device
Definition: InputEvent.h:45
Definition: ThumbstickEvent.h:8
float yValue
Definition: ThumbstickEvent.h:46
static constexpr auto RTTI
Definition: ThumbstickEvent.h:10
bool IsLeft() const
bool IsRight() const
float xValue
Definition: ThumbstickEvent.h:45
void Init(InputType a_id, INPUT_DEVICE a_device, float a_xValue, float a_yValue, const RE::BSFixedString &a_userEvent)
Definition: ThumbstickEvent.h:32
void Init(InputType a_id, INPUT_DEVICE a_device, float a_xValue, float a_yValue)
Definition: ThumbstickEvent.h:27
void Init(InputType a_id, float a_xValue, float a_yValue)
Definition: ThumbstickEvent.h:22
Definition: AbsorbEffect.h:6
constexpr REL::ID RTTI_ThumbstickEvent
Definition: Offsets_RTTI.h:6104
INPUT_DEVICE
Definition: InputDevices.h:8
Definition: ThumbstickEvent.h:13
InputType
Definition: ThumbstickEvent.h:15
@ kRightThumbstick
Definition: ThumbstickEvent.h:17
@ kLeftThumbstick
Definition: ThumbstickEvent.h:16