CommonLibSSE NG
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 
29  virtual ~InputEvent(); // 00
30 
31  [[nodiscard]] virtual bool HasIDCode() const; // 01 - { return false; }
32  [[nodiscard]] virtual const BSFixedString& QUserEvent() const; // 02 - { return ""; }
33 
34  [[nodiscard]] constexpr INPUT_EVENT_TYPE GetEventType() const noexcept { return *eventType; }
35  [[nodiscard]] constexpr INPUT_DEVICE GetDevice() const noexcept { return *device; }
36 
37  [[nodiscard]] ButtonEvent* AsButtonEvent();
38  [[nodiscard]] const ButtonEvent* AsButtonEvent() const;
39 
40  [[nodiscard]] CharEvent* AsCharEvent();
41  [[nodiscard]] const CharEvent* AsCharEvent() const;
42 
43  [[nodiscard]] IDEvent* AsIDEvent();
44  [[nodiscard]] const IDEvent* AsIDEvent() const;
45 
46  [[nodiscard]] MouseMoveEvent* AsMouseMoveEvent();
47  [[nodiscard]] const MouseMoveEvent* AsMouseMoveEvent() const;
48 
50  [[nodiscard]] const ThumbstickEvent* AsThumbstickEvent() const;
51 
52  // members
55  InputEvent* next; // 10
56  };
57  static_assert(sizeof(InputEvent) == 0x18);
58 }
Definition: ButtonEvent.h:11
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:53
constexpr INPUT_EVENT_TYPE GetEventType() const noexcept
Definition: InputEvent.h:34
const MouseMoveEvent * AsMouseMoveEvent() const
virtual bool HasIDCode() const
stl::enumeration< INPUT_EVENT_TYPE, std::uint32_t > eventType
Definition: InputEvent.h:54
ThumbstickEvent * AsThumbstickEvent()
CharEvent * AsCharEvent()
ButtonEvent * AsButtonEvent()
IDEvent * AsIDEvent()
constexpr INPUT_DEVICE GetDevice() const noexcept
Definition: InputEvent.h:35
virtual const BSFixedString & QUserEvent() const
const IDEvent * AsIDEvent() const
const CharEvent * AsCharEvent() const
const ButtonEvent * AsButtonEvent() const
InputEvent * next
Definition: InputEvent.h:55
Definition: MouseMoveEvent.h:8
Definition: ThumbstickEvent.h:8
Definition: AbsorbEffect.h:6
constexpr REL::VariantID RTTI_InputEvent(687041, 394890, 0x1f0b210)
INPUT_EVENT_TYPE
Definition: InputEvent.h:9
INPUT_DEVICE
Definition: InputDevices.h:8