Event
Category | class |
Type | hime_event_t |
Generic input event type.
Methods
int hime_event_get_flags(self)
Return bit fields of Event::Flag
s.
Parameters
hime_event_const_t
self
Return
int
hime_event_type_t hime_event_get_type(self)
Return the event type.
Parameters
hime_event_const_t
self
Return
hime_event_type_t
bool hime_event_is_cancelable(self)
Return whether this event can be cancelled.
By default, events are "cancelable", this means any default processing that
the containing abstraction layer may perform can be prevented by calling
SetHandled()
. SetHandled()
or StopPropagation()
must not be called
for events that are not cancelable.
Parameters
hime_event_const_t
self
Return
bool
void hime_event_set_handled(self)
Mark the event as having been handled.
A handled event does not reach the next event phase. For example, if an event is handled during the pre-target phase, then the event is dispatched to all pre-target handlers, but not to the target or post-target handlers.
Note that SetHandled()
can be called only for cancelable events.
Parameters
hime_event_t
self
Return
void
bool hime_event_is_handled(self)
Return whether the event has been handled.
Parameters
hime_event_const_t
self
Return
bool
void hime_event_stop_propagation(self)
Immediately stop the propagation of the event.
This must be called only from an EventHandler during an event-dispatch. Any event handler that may be in the list will not receive the event after this is called.
Note that StopPropagation()
can be called only for cancelable events.
Parameters
hime_event_t
self
Return
void
bool hime_event_is_consumed(self)
Return whether StopPropagation has been called.
Parameters
hime_event_const_t
self
Return
bool
void hime_event_set_skipped(self)
Mark the event as skipped.
This immediately stops the propagation of the event like
StopPropagation()
but sets an extra bit so that the dispatcher of the
event can use this extra information to decide to handle the event
themselves.
For example in the case of ash-chrome - lacros-chrome interaction in ChromeOS, lacros-chrome can mark the event as 'skipped' to stop the propagation, but also notifies ash-chroem that the event was not handled in lacros.
Note that IsHandled()
will still return true to stop the event from
being passed to the next phase.
Note that SetSkipped()
can be called only for cancelable events.
Parameters
hime_event_t
self
Return
void