HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Data Fields | Friends
v1::gui_event Class Reference

#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
 
 gui_event (gui_event_type type) noexcept
 
 gui_event (gui_event_type type, hi::grapheme grapheme) noexcept
 
 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
 
constexpr gui_event (gui_event const &) noexcept=default
 
constexpr gui_event (gui_event &&) noexcept=default
 
constexpr gui_eventoperator= (gui_event const &) noexcept=default
 
constexpr gui_eventoperator= (gui_event &&) noexcept=default
 
constexpr gui_event_type type () const noexcept
 
constexpr void set_type (gui_event_type type) noexcept
 Change the type of the gui_event.
 
mouse_event_datamouse () noexcept
 
mouse_event_data const & mouse () const noexcept
 
keyboard_virtual_key & key () noexcept
 
keyboard_virtual_key const & key () const noexcept
 
hi::grapheme & grapheme () noexcept
 
hi::grapheme const & grapheme () 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
 

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* (geo::transformer auto const &transform, gui_event const &rhs) noexcept
 

Detailed Description

A user interface event.

Member Function Documentation

◆ drag_delta()

constexpr vector2 v1::gui_event::drag_delta ( ) const
inlineconstexprnoexcept

Get the location of the mouse relative to the start of a drag.

◆ is_left_button_up()

constexpr bool v1::gui_event::is_left_button_up ( aarectangle active_area) const
inlineconstexprnoexcept

Check if this event is for a left-button-up event while the mouse pointer is in the given area.

◆ set_type()

constexpr void v1::gui_event::set_type ( gui_event_type type)
inlineconstexprnoexcept

Change the type of the gui_event.

Note
If the variant changes of this event the associated data is cleared.
Parameters
typeThe new type for the gui_event.

Field Documentation

◆ keyboard_modifiers

keyboard_modifiers 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

keyboard_state v1::gui_event::keyboard_state

State of the keyboard; caps-lock, num-lock, scroll-lock.

◆ time_point

utc_nanoseconds v1::gui_event::time_point

The time when the event was created.


The documentation for this class was generated from the following file: