About my projects, examples and tutorials
Gnome::Gtk4::KeyvalTrigger

Gnome::Gtk4::KeyvalTrigger

Description§

A Gnome::Gtk4::ShortcutTrigger that triggers when a specific keyval and modifiers are pressed.

Uml Diagram§

UNKNOWN image§

=for image :class<inline> :src<asset_files/images/plantuml/KeyvalTrigger.png> :width<70\%>

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! )
Code

new-keyvaltrigger§

Creates a Gnome::Gtk4::ShortcutTrigger that will trigger whenever the key with the given $keyval and $modifiers is pressed.

method new-keyvaltrigger (
  UInt() $keyval, UInt $modifiers
  --> Gnome::Gtk4::KeyvalTrigger
)
Code
  • $keyval; The keyval to trigger for.
  • $modifiers; the modifiers that need to be present.

Example§

Example to initialize the object

my Gnome::Gtk4::KeyvalTrigger $keyvaltrigger;
$keyvaltrigger .= new-keyvaltrigger( GDK_KEY_M, GDK_SHIFT_MASK);
Code

Methods§

get-keyval§

Gets the keyval that must be pressed to succeed triggering this object.

method get-keyval ( --> UInt )
Code

Return value; the keyval. Note that the key value can be changed. Tests show that uppercase letters are changed to lowercase.

get-modifiers§

Gets the modifiers that must be present to succeed triggering this object.

method get-modifiers ( --> UInt )
Code

Return value; the modifiers.