14#include <egt/detail/meta.h>
16#include <egt/geometry.h>
17#include <egt/keycode.h>
120 size_t s = 0) noexcept
129 return point - drag_start;
152static_assert(detail::rule_of_5<Pointer>(),
"must fulfill rule of 5");
168 shift = detail::bit(0),
169 control = detail::bit(1),
170 lock = detail::bit(2),
175 constexpr Key() noexcept = default;
213static_assert(detail::rule_of_5<Key>(),
"must fulfill rule of 5");
236 EGT_NODISCARD
bool quit()
const
256 constexpr Event() noexcept = default;
356 m_postponed_stop =
true;
365 return m_postponed_stop;
388 bool m_postponed_stop{
false};
391static_assert(detail::rule_of_5<Event>(),
"must fulfill rule of 5");
Base event argument class.
Definition event.h:222
bool m_stop
Is the event stopped.
Definition event.h:244
void stop()
Stop the event from propagating.
Definition event.h:228
EGT_NODISCARD bool quit() const
Was the event stopped from propagating?
Definition event.h:236
Utility class for managing a set of flags with the ability to observe changes to the flags.
Definition flags.h:40
EventId
Event identifiers.
Definition event.h:36
@ raw_pointer_up
Raw pointer event.
@ keyboard_repeat
Keyboard event.
@ raw_pointer_move
Raw pointer event.
@ pointer_drag_stop
Pointer event.
@ raw_pointer_down
Raw pointer event.
@ pointer_click
Pointer event.
@ pointer_hold
Pointer event.
@ pointer_drag
Pointer event.
@ keyboard_down
Keyboard event.
@ pointer_dblclick
Pointer event.
@ keyboard_up
Keyboard event.
@ pointer_drag_start
Pointer event.
constexpr T bit(T n)
Utility to create a bit mask for the specified bit.
Definition meta.h:306
KeyboardCode
Key codes that represent a physical key.
Definition keycode.h:26
@ EKEY_UNKNOWN
Definition keycode.h:27
T & right(T &widget)
Helper to set alignment of a widget.
Definition widgetflags.h:468
T & left(T &widget)
Helper to set alignment of a widget.
Definition widgetflags.h:442
EGT_API std::ostream & operator<<(std::ostream &os, const Color &color)
Overloaded std::ostream insertion operator.
EGT framework namespace.
Definition animation.h:24
A single event that has information about the event and state for the event.
Definition event.h:255
constexpr Event(EventId id, const Key &key) noexcept
Definition event.h:278
EGT_NODISCARD const Pointer & pointer() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition event.h:317
Pointer m_pointer
Pointer event data.
Definition event.h:383
EGT_NODISCARD const EventId & id() const noexcept
Get the id of the event.
Definition event.h:284
Key m_key
Key event data.
Definition event.h:378
EGT_NODISCARD bool postponed_quit() const
Was the event scheduled to be stopped just after the latest handle() completes?
Definition event.h:363
void id(EventId id)
Change the id of the event.
Definition event.h:290
constexpr Event() noexcept=default
constexpr Event(EventId id, const Pointer &pointer) noexcept
Definition event.h:269
EGT_NODISCARD const Key & key() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition event.h:338
void grab(Widget *widget)
Grab any related following events to this one.
Pointer & pointer()
Get the Pointer event data.
Definition event.h:309
void postpone_stop()
Stop the event from propagating but only after the current handle() completes.
Definition event.h:354
Key & key()
Get the Key event data.
Definition event.h:330
Keyboard event data.
Definition event.h:165
constexpr Key() noexcept=default
KeyMod
Definition event.h:167
Pointer event data.
Definition event.h:79
Button
Definitions for pointer buttons.
Definition event.h:84
constexpr Pointer() noexcept=default
constexpr Pointer(const DisplayPoint &p, Button b, size_t s=0) noexcept
Definition event.h:107
constexpr Pointer(const DisplayPoint &p, const DisplayPoint &d, size_t s=0) noexcept
Definition event.h:118
EGT_NODISCARD DisplayPoint delta() const
Get the drag delta.
Definition event.h:127
DisplayPoint point
Mouse position in display coordinates.
Definition event.h:133
DisplayPoint drag_start
The mouse point where EventId::pointer_drag_start occurred.
Definition event.h:146