1.1-rc3
Public Member Functions | Protected Attributes | List of all members
Event Struct Reference

A single event that has information about the event and state for the event. More...

Inheritance diagram for Event:
Inheritance graph
[legend]

Public Member Functions

constexpr Event () noexcept=default
 
constexpr Event (EventId id) noexcept
 
constexpr Event (EventId id, const Key &key) noexcept
 
constexpr Event (EventId id, const Pointer &pointer) noexcept
 
void grab (Widget *widget)
 Grab any related following events to this one. More...
 
const EGT_NODISCARD EventIdid () const noexcept
 Get the id of the event. More...
 
void id (EventId id)
 Change the id of the event. More...
 
Keykey ()
 Get the Key event data. More...
 
const EGT_NODISCARD Keykey () const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
Pointerpointer ()
 Get the Pointer event data. More...
 
const EGT_NODISCARD Pointerpointer () const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
- Public Member Functions inherited from EventArg
EGT_NODISCARD bool quit () const
 Was the event stopped from propagating? More...
 
void stop ()
 Stop the event from propagating. More...
 

Protected Attributes

EventId m_id {EventId::none}
 The EventId. More...
 
Key m_key
 Key event data. More...
 
Pointer m_pointer
 Pointer event data. More...
 
- Protected Attributes inherited from EventArg
bool m_stop {false}
 Is the event stopped. More...
 

Detailed Description

A single event that has information about the event and state for the event.

Constructor & Destructor Documentation

◆ Event() [1/4]

constexpr Event ( )
constexprdefaultnoexcept

◆ Event() [2/4]

constexpr Event ( EventId  id)
inlineexplicitconstexprnoexcept
Parameters
[in]idEvent id.

◆ Event() [3/4]

constexpr Event ( EventId  id,
const Pointer pointer 
)
inlineconstexprnoexcept
Parameters
[in]idEvent id.
[in]pointerPointer data for the event.

◆ Event() [4/4]

constexpr Event ( EventId  id,
const Key key 
)
inlineconstexprnoexcept
Parameters
[in]idEvent id.
[in]keyKey data for the event.

Member Function Documentation

◆ grab()

void grab ( Widget widget)

Grab any related following events to this one.

Note
grab() implies stop().

◆ id() [1/2]

const EGT_NODISCARD EventId& id ( ) const
inlinenoexcept

Get the id of the event.

◆ id() [2/2]

void id ( EventId  id)
inline

Change the id of the event.

◆ key() [1/2]

Key& key ( )
inline

Get the Key event data.

Only valid with the following events:

◆ key() [2/2]

const EGT_NODISCARD Key& key ( ) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ pointer() [1/2]

Pointer& pointer ( )
inline

◆ pointer() [2/2]

const EGT_NODISCARD Pointer& pointer ( ) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Member Data Documentation

◆ m_id

EventId m_id {EventId::none}
protected

The EventId.

◆ m_key

Key m_key
protected

Key event data.

◆ m_pointer

Pointer m_pointer
protected

Pointer event data.