About my projects, examples and tutorials
Gnome::Gdk4::KeyEvent

Gnome::Gdk4::KeyEvent

Description

An event related to a key-based device.

Class initialization

new

:native-object

Create an object using a native object from an object of the same type found elsewhere. See also Gnome::N::TopLevelSupportClass.

multi method new ( N-Object() :$native-object! )

Methods

get-consumed-modifiers

Extracts the consumed modifiers from a key event.

method get-consumed-modifiers (--> UInt )

Return value; the consumed modifiers or $event.

get-keycode

Extracts the keycode from a key event.

method get-keycode (--> UInt )

Return value; the keycode of $event.

get-keyval

Extracts the keyval from a key event.

method get-keyval (--> UInt )

Return value; the keyval of $event.

get-layout

Extracts the layout from a key event.

method get-layout (--> UInt )

Return value; the layout of $event.

get-level

Extracts the shift level from a key event.

method get-level (--> UInt )

Return value; the shift level of $event.

get-match

Gets a keyval and modifier combination that will match the event.

See .matches().

method get-match ( Array[Int] $keyval, UInt $modifiers --> Bool )
  • $keyval; (transfer ownership: full) return location for a keyval.

  • $modifiers; (transfer ownership: full) return location for modifiers.

Return value; True on success.

is-modifier

Extracts whether the key event is for a modifier key.

method is-modifier (--> Bool )

Return value; True if the $event is for a modifier key.

matches This function is not yet available

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.

method matches ( UInt() $keyval, UInt $modifiers --> GdkKeyMatch  )
  • $keyval; the keyval to match.

  • $modifiers; the modifiers to match.

Return value; a enumeration GdkKeyMatch defined in Gnome::Gdk4::T-events value describing whether $event matches.