Struct gdk4::KeyEvent [−][src]
pub struct KeyEvent(_);
Expand description
An event related to a key-based device.
Implementations
Matches a key event against a keyval and modifiers.
This is typically used to trigger keyboard shortcuts such as Ctrl-C.
Partial matches are possible where the combination matches if the currently active group is ignored.
Note that we ignore Caps Lock for matching.
keyval
the keyval to match
modifiers
the modifiers to match
Returns
a KeyMatch
value describing whether self
matches
Methods from Deref<Target = Event>
Retrieves the history of the device that self
is for, as a list of
time and coordinates.
The history includes positions that are not delivered as separate events
to the application because they occurred in the same frame as self
.
Note that only motion and scroll events record history, and motion events do it only if one of the mouse buttons is down.
Returns
an array of time and coordinates
Returns the timestamp of self
.
Not all events have timestamps. In that case, this function
returns GDK_CURRENT_TIME
.
Returns
timestamp field from self
Returns whether a Event
should trigger a context menu,
according to platform conventions.
The right mouse button typically triggers context menus.
This function should always be used instead of simply checking for
event->button == GDK_BUTTON_SECONDARY
.
Returns
true
if the event should trigger a context menu.
Trait Implementations
Returns the type identifier of Self
.
Auto Trait Implementations
impl RefUnwindSafe for KeyEvent
impl UnwindSafe for KeyEvent
Blanket Implementations
Mutably borrows from an owned value. Read more