CommonLibSSE (Parapets fork)
Loading...
Searching...
No Matches
ButtonEvent.h
Go to the documentation of this file.
1#pragma once
2
4#include "RE/I/IDEvent.h"
5#include "RE/I/InputEvent.h"
6
7namespace RE
8{
9 class ButtonEvent : public IDEvent
10 {
11 public:
12 inline static constexpr auto RTTI = RTTI_ButtonEvent;
13
14 ~ButtonEvent() override; // 00
15
16 [[nodiscard]] constexpr float Value() const noexcept { return value; }
17 [[nodiscard]] constexpr float HeldDuration() const noexcept { return heldDownSecs; }
18 [[nodiscard]] constexpr bool IsPressed() const noexcept { return Value() > 0.0F; }
19 [[nodiscard]] constexpr bool IsRepeating() const noexcept { return HeldDuration() > 0.0F; }
20 [[nodiscard]] constexpr bool IsDown() const noexcept { return IsPressed() && (HeldDuration() == 0.0F); }
21 [[nodiscard]] constexpr bool IsHeld() const noexcept { return IsPressed() && IsRepeating(); }
22 [[nodiscard]] constexpr bool IsUp() const noexcept { return (Value() == 0.0F) && IsRepeating(); }
23
24 // members
25 float value; // 28
26 float heldDownSecs; // 2C
27 };
28 static_assert(sizeof(ButtonEvent) == 0x30);
29}
Definition: ButtonEvent.h:10
static constexpr auto RTTI
Definition: ButtonEvent.h:12
constexpr float Value() const noexcept
Definition: ButtonEvent.h:16
float heldDownSecs
Definition: ButtonEvent.h:26
constexpr bool IsRepeating() const noexcept
Definition: ButtonEvent.h:19
float value
Definition: ButtonEvent.h:25
constexpr bool IsHeld() const noexcept
Definition: ButtonEvent.h:21
constexpr bool IsDown() const noexcept
Definition: ButtonEvent.h:20
~ButtonEvent() override
constexpr bool IsPressed() const noexcept
Definition: ButtonEvent.h:18
constexpr float HeldDuration() const noexcept
Definition: ButtonEvent.h:17
constexpr bool IsUp() const noexcept
Definition: ButtonEvent.h:22
Definition: IDEvent.h:9
Definition: AbsorbEffect.h:6
constexpr REL::ID RTTI_ButtonEvent
Definition: Offsets_RTTI.h:3693