56 lines
968 B
C++
56 lines
968 B
C++
#pragma once
|
|
#include "../base/Bitmask.h"
|
|
#include <cstdint>
|
|
|
|
namespace renderive {
|
|
|
|
enum class Event_Type : std::uint8_t {
|
|
Resize,
|
|
Show,
|
|
Hide,
|
|
Leave,
|
|
Pointer_Move,
|
|
Pointer_Press,
|
|
Pointer_Release,
|
|
Wheel,
|
|
Key_Press,
|
|
Key_Release
|
|
};
|
|
|
|
struct Event {
|
|
explicit Event(Event_Type t) : type(t) {}
|
|
virtual ~Event() = default;
|
|
void accept() const {
|
|
accepted = true;
|
|
}
|
|
void ignore() const {
|
|
accepted = false;
|
|
}
|
|
[[nodiscard]] bool is_accepted() const {
|
|
return accepted;
|
|
}
|
|
Event_Type type;
|
|
private:
|
|
mutable bool accepted = false;
|
|
};
|
|
|
|
enum class Mouse_Button : std::uint8_t {
|
|
None,
|
|
Left,
|
|
Right,
|
|
Middle
|
|
};
|
|
|
|
enum class Keyboard_Modifier : std::uint8_t {
|
|
Ctrl = 1 << 0,
|
|
Shift = 1 << 1,
|
|
Alt = 1 << 2,
|
|
Meta = 1 << 3
|
|
};
|
|
|
|
using Keyboard_Modifier_Mask = Keyboard_Modifier;
|
|
|
|
} // namespace renderive
|
|
|
|
RENDERIVE_ENABLE_BITMASK(renderive::Keyboard_Modifier)
|