HikoGUI
A low latency retained GUI
|
#include <hikogui/GUI/gui_event.hpp>
Public Member Functions | |
constexpr | gui_event (gui_event_type type, utc_nanoseconds time_point, hi::keyboard_modifiers keyboard_modifiers, hi::keyboard_state keyboard_state) noexcept |
Create a GUI event. | |
constexpr | gui_event () noexcept |
Create an empty GUI event. | |
gui_event (gui_event_type type) noexcept | |
Create am empty GUI event. | |
gui_event (gui_event_type type, aarectangle rectangle) noexcept | |
Create a rectangle event. | |
gui_event (gui_event_type type, keyboard_virtual_key key, hi::keyboard_modifiers keyboard_modifiers=keyboard_modifiers::none, hi::keyboard_state keyboard_state=keyboard_state::idle) noexcept | |
Create a GUI event. | |
constexpr | gui_event (gui_event const &) noexcept=default |
constexpr | gui_event (gui_event &&) noexcept=default |
constexpr gui_event & | operator= (gui_event const &) noexcept=default |
constexpr gui_event & | operator= (gui_event &&) noexcept=default |
constexpr gui_event_type | type () const noexcept |
Get the event type. | |
constexpr void | set_type (gui_event_type type) noexcept |
Change the type of the gui_event. | |
mouse_event_data & | mouse () noexcept |
Get the mouse event information. | |
mouse_event_data const & | mouse () const noexcept |
Get the mouse event information. | |
keyboard_virtual_key & | key () noexcept |
Get the key from the keyboard event. | |
keyboard_virtual_key const & | key () const noexcept |
Get the key from the keyboard event. | |
hi::grapheme & | grapheme () noexcept |
Get the grapheme entered on the keyboard. | |
hi::grapheme const & | grapheme () const noexcept |
Get the grapheme entered on the keyboard. | |
aarectangle & | rectangle () noexcept |
aarectangle const & | rectangle () const noexcept |
keyboard_target_data & | keyboard_target () noexcept |
keyboard_target_data const & | keyboard_target () const noexcept |
gstring & | clipboard_data () noexcept |
gstring const & | clipboard_data () const noexcept |
constexpr bool | operator== (gui_event_type event_type) const noexcept |
constexpr bool | operator== (gui_event_variant event_variant) const noexcept |
constexpr bool | empty () const noexcept |
constexpr | operator bool () const noexcept |
constexpr gui_event_variant | variant () const noexcept |
constexpr bool | is_left_button_up (aarectangle active_area) const noexcept |
Check if this event is for a left-button-up event while the mouse pointer is in the given area. | |
constexpr vector2 | drag_delta () const noexcept |
Get the location of the mouse relative to the start of a drag. | |
Static Public Member Functions | |
static gui_event | make_mouse_enter (point2 position) noexcept |
Create a mouse enter event. | |
static gui_event | keyboard_grapheme (hi::grapheme grapheme) noexcept |
static gui_event | keyboard_partial_grapheme (hi::grapheme grapheme) noexcept |
static gui_event | window_set_keyboard_target (widget_id id, keyboard_focus_group group=keyboard_focus_group::normal, keyboard_focus_direction direction=keyboard_focus_direction::here) noexcept |
static gui_event | make_clipboard_event (gui_event_type type, gstring_view text) noexcept |
Create clipboard event. | |
Data Fields | |
utc_nanoseconds | time_point |
The time when the event was created. | |
keyboard_modifiers | keyboard_modifiers |
Keyboard modifiers: shift, ctrl, alt, etc. | |
keyboard_state | keyboard_state |
State of the keyboard; caps-lock, num-lock, scroll-lock. | |
Friends | |
constexpr friend gui_event | operator* (translate2 const &transform, gui_event const &rhs) noexcept |
Transform a gui-event to another coordinate system. | |
A user interface event.
|
inlineconstexprnoexcept |
Create a GUI event.
type | The type of the event. |
time_point | The time when the was received. |
keyboard_modifiers | A list of modifiers key that where hold down: alt, ctrl, shift. |
keyboard_state | The state of the keyboard: scroll-lock, num-lock, caps-lock. |
|
inlineconstexprnoexcept |
Create an empty GUI event.
|
inlinenoexcept |
Create am empty GUI event.
type | The type of the event. |
|
inlinenoexcept |
Create a rectangle event.
type | The type of the rectangle event. |
rectangle | The rectangle for this event. |
|
inlinenoexcept |
Create a GUI event.
type | The type of the key event. |
key | The virtual key that was pressed/released |
keyboard_modifiers | A list of modifiers key that where hold down: alt, ctrl, shift. |
keyboard_state | The state of the keyboard: scroll-lock, num-lock, caps-lock. |
|
inlineconstexprnoexcept |
Get the location of the mouse relative to the start of a drag.
|
inlinenoexcept |
Get the grapheme entered on the keyboard.
|
inlinenoexcept |
Get the grapheme entered on the keyboard.
|
inlineconstexprnoexcept |
Check if this event is for a left-button-up event while the mouse pointer is in the given area.
|
inlinenoexcept |
Get the key from the keyboard event.
|
inlinenoexcept |
Get the key from the keyboard event.
|
inlinestaticnoexcept |
Create clipboard event.
type | Either gui_event_type::text_edit_paste or gui_event_type::window_set_clipboard . |
text | The clipboard data in text form. |
|
inlinestaticnoexcept |
Create a mouse enter event.
position | The position where the mouse entered. |
|
inlinenoexcept |
Get the mouse event information.
|
inlinenoexcept |
Get the mouse event information.
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
Get the event type.
|
friend |
Transform a gui-event to another coordinate system.
This operations is used mostly to transform mouse evens to a widget's local coordinate system.
transform | The transform object |
rhs | The event to transform. |
keyboard_modifiers hi::v1::gui_event::keyboard_modifiers |
Keyboard modifiers: shift, ctrl, alt, etc.
This may be used for in combination with both keyboard and mouse events.
keyboard_state hi::v1::gui_event::keyboard_state |
State of the keyboard; caps-lock, num-lock, scroll-lock.
utc_nanoseconds hi::v1::gui_event::time_point |
The time when the event was created.