CommonLibVR
InputEvent.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/B/BSFixedString.h"
4 #include "RE/I/InputDevices.h"
5 
6 namespace RE
7 {
8  enum class INPUT_EVENT_TYPE
9  {
10  kButton = 0,
11  kMouseMove,
12  kChar,
15  kKinect
16  };
17 
18  class ButtonEvent;
19  class CharEvent;
20  class IDEvent;
21  class MouseMoveEvent;
22  class ThumbstickEvent;
23 
24  class InputEvent
25  {
26  public:
27  inline static constexpr auto RTTI = RTTI_InputEvent;
28  inline static constexpr auto VTABLE = VTABLE_InputEvent;
29 
30  virtual ~InputEvent(); // 00
31 
32  [[nodiscard]] virtual bool HasIDCode() const; // 01 - { return false; }
33  [[nodiscard]] virtual const BSFixedString& QUserEvent() const; // 02 - { return ""; }
34 
35  [[nodiscard]] constexpr INPUT_EVENT_TYPE GetEventType() const noexcept { return *eventType; }
36  [[nodiscard]] constexpr INPUT_DEVICE GetDevice() const noexcept { return *device; }
37 
38  [[nodiscard]] ButtonEvent* AsButtonEvent();
39  [[nodiscard]] const ButtonEvent* AsButtonEvent() const;
40 
41  [[nodiscard]] CharEvent* AsCharEvent();
42  [[nodiscard]] const CharEvent* AsCharEvent() const;
43 
44  [[nodiscard]] IDEvent* AsIDEvent();
45  [[nodiscard]] const IDEvent* AsIDEvent() const;
46 
47  [[nodiscard]] MouseMoveEvent* AsMouseMoveEvent();
48  [[nodiscard]] const MouseMoveEvent* AsMouseMoveEvent() const;
49 
51  [[nodiscard]] const ThumbstickEvent* AsThumbstickEvent() const;
52 
53  // members
56  InputEvent* next; // 10
57  private:
58  KEEP_FOR_RE()
59  };
60  static_assert(sizeof(InputEvent) == 0x18);
61 }
#define KEEP_FOR_RE()
Definition: PCH.h:713
Definition: ButtonEvent.h:16
Definition: CharEvent.h:8
Definition: IDEvent.h:9
Definition: InputEvent.h:25
const ThumbstickEvent * AsThumbstickEvent() const
MouseMoveEvent * AsMouseMoveEvent()
virtual ~InputEvent()
static constexpr auto RTTI
Definition: InputEvent.h:27
stl::enumeration< INPUT_DEVICE, std::uint32_t > device
Definition: InputEvent.h:54
constexpr INPUT_EVENT_TYPE GetEventType() const noexcept
Definition: InputEvent.h:35
const MouseMoveEvent * AsMouseMoveEvent() const
virtual bool HasIDCode() const
stl::enumeration< INPUT_EVENT_TYPE, std::uint32_t > eventType
Definition: InputEvent.h:55
ThumbstickEvent * AsThumbstickEvent()
CharEvent * AsCharEvent()
ButtonEvent * AsButtonEvent()
IDEvent * AsIDEvent()
constexpr INPUT_DEVICE GetDevice() const noexcept
Definition: InputEvent.h:36
virtual const BSFixedString & QUserEvent() const
const IDEvent * AsIDEvent() const
const CharEvent * AsCharEvent() const
const ButtonEvent * AsButtonEvent() const
static constexpr auto VTABLE
Definition: InputEvent.h:28
InputEvent * next
Definition: InputEvent.h:56
Definition: MouseMoveEvent.h:8
Definition: ThumbstickEvent.h:8
Definition: AbsorbEffect.h:6
constexpr std::array< REL::ID, 1 > VTABLE_InputEvent
Definition: Offsets_VTABLE.h:11913
constexpr REL::ID RTTI_InputEvent(static_cast< std::uint64_t >(687041))
INPUT_EVENT_TYPE
Definition: InputEvent.h:9
INPUT_DEVICE
Definition: InputDevices.h:8