Skip to content

Gtk.AlternativeTrigger

class — extends ShortcutTrigger

Combines two shortcut triggers.

The GtkAlternativeTrigger triggers when either of the two trigger.

This can be cascaded to combine more than two triggers.

Constructors

new

@classmethod
def new(cls, first: ShortcutTrigger, second: ShortcutTrigger) -> ShortcutTrigger

Creates a GtkShortcutTrigger that will trigger whenever either of the two given triggers gets triggered.

Note that nesting is allowed, so if you want more than two alternative, create a new alternative trigger for each option.

Parameters:

  • first — The first trigger that may trigger
  • second — The second trigger that may trigger

Methods

get_first

def get_first(self) -> ShortcutTrigger

Gets the first of the two alternative triggers that may trigger self.

AlternativeTrigger.get_second will return the other one.

get_second

def get_second(self) -> ShortcutTrigger

Gets the second of the two alternative triggers that may trigger self.

AlternativeTrigger.get_first will return the other one.

Properties

first

first: ShortcutTrigger  # read/write

The first GtkShortcutTrigger to check.

second

second: ShortcutTrigger  # read/write

The second GtkShortcutTrigger to check.