Skip to content

Gtk.KeyvalTrigger

class — extends ShortcutTrigger

Triggers when a specific keyval and modifiers are pressed.

Constructors

new

@classmethod
def new(cls, keyval: int, modifiers: Gdk.ModifierType | int) -> ShortcutTrigger

Creates a GtkShortcutTrigger that will trigger whenever the key with the given keyval and modifiers is pressed.

Parameters:

  • keyval — The keyval to trigger for
  • modifiers — the modifiers that need to be present

Methods

get_keyval

def get_keyval(self) -> int

Gets the keyval that must be pressed to succeed triggering self.

get_modifiers

def get_modifiers(self) -> Gdk.ModifierType

Gets the modifiers that must be present to succeed triggering self.

Properties

keyval

keyval: int  # read/write

The key value for the trigger.

modifiers

modifiers: Gdk.ModifierType | int  # read/write

The key modifiers for the trigger.