CommonLibVR
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  inline static constexpr auto VTABLE = VTABLE_ThumbstickEvent;
12 
13  struct InputTypes
14  {
15  enum InputType : std::uint32_t
16  {
18  kRightThumbstick = 0x0C
19  };
20  };
22 
23  void Init(InputType a_id, float a_xValue, float a_yValue)
24  {
25  Init(a_id, INPUT_DEVICE::kGamepad, a_xValue, a_yValue, ""sv);
26  }
27 
28  void Init(InputType a_id, INPUT_DEVICE a_device, float a_xValue, float a_yValue)
29  {
30  Init(a_id, a_device, a_xValue, a_yValue, ""sv);
31  }
32 
33  void Init(InputType a_id, INPUT_DEVICE a_device, float a_xValue, float a_yValue, const RE::BSFixedString& a_userEvent)
34  {
35  xValue = a_xValue;
36  yValue = a_yValue;
37  device = a_device;
38  idCode = a_id;
39  userEvent = a_userEvent;
40  }
41 
42 #ifndef SKYRIMVR
43  [[nodiscard]] bool IsLeft() const;
44  [[nodiscard]] bool IsRight() const;
45 #else
46  [[nodiscard]] bool IsOffHand() const;
47  [[nodiscard]] bool IsMainHand() const;
48 #endif
49 
50  // members
51  float xValue; // 28
52  float yValue; // 2C
53  private:
54  KEEP_FOR_RE()
55  };
56  static_assert(sizeof(ThumbstickEvent) == 0x30);
57 }
#define KEEP_FOR_RE()
Definition: PCH.h:713
Definition: IDEvent.h:9
std::uint32_t idCode
Definition: IDEvent.h:24
BSFixedString userEvent
Definition: IDEvent.h:23
stl::enumeration< INPUT_DEVICE, std::uint32_t > device
Definition: InputEvent.h:54
Definition: ThumbstickEvent.h:8
float yValue
Definition: ThumbstickEvent.h:52
static constexpr auto RTTI
Definition: ThumbstickEvent.h:10
bool IsLeft() const
static constexpr auto VTABLE
Definition: ThumbstickEvent.h:11
bool IsRight() const
float xValue
Definition: ThumbstickEvent.h:51
void Init(InputType a_id, INPUT_DEVICE a_device, float a_xValue, float a_yValue, const RE::BSFixedString &a_userEvent)
Definition: ThumbstickEvent.h:33
void Init(InputType a_id, INPUT_DEVICE a_device, float a_xValue, float a_yValue)
Definition: ThumbstickEvent.h:28
void Init(InputType a_id, float a_xValue, float a_yValue)
Definition: ThumbstickEvent.h:23
Definition: AbsorbEffect.h:6
constexpr std::array< REL::ID, 1 > VTABLE_ThumbstickEvent
Definition: Offsets_VTABLE.h:12932
constexpr REL::ID RTTI_ThumbstickEvent(static_cast< std::uint64_t >(688897))
INPUT_DEVICE
Definition: InputDevices.h:8
Definition: ThumbstickEvent.h:14
InputType
Definition: ThumbstickEvent.h:16
@ kRightThumbstick
Definition: ThumbstickEvent.h:18
@ kLeftThumbstick
Definition: ThumbstickEvent.h:17