Shortcut

class Shortcut(**properties: Any)

Superclasses: Object

Constructors:

Shortcut(**properties)
new(trigger:Gtk.ShortcutTrigger=None, action:Gtk.ShortcutAction=None) -> Gtk.Shortcut

Constructors

class Shortcut
classmethod new(trigger: ShortcutTrigger | None = None, action: ShortcutAction | None = None) Shortcut

Creates a new GtkShortcut that is triggered by trigger and then activates action.

Parameters:
  • trigger – The trigger that will trigger the shortcut

  • action – The action that will be activated upon triggering

Methods

class Shortcut
get_action() ShortcutAction | None

Gets the action that is activated by this shortcut.

get_arguments() Variant | None

Gets the arguments that are passed when activating the shortcut.

get_trigger() ShortcutTrigger | None

Gets the trigger used to trigger self.

set_action(action: ShortcutAction | None = None) None

Sets the new action for self to be action.

Parameters:

action – The new action. If the action is None, the nothing action will be used.

set_arguments(args: Variant | None = None) None

Sets the arguments to pass when activating the shortcut.

Parameters:

args – arguments to pass when activating self

set_trigger(trigger: ShortcutTrigger | None = None) None

Sets the new trigger for self to be trigger.

Parameters:

trigger – The new trigger. If the trigger is None, the never trigger will be used.

Properties

class Shortcut
props.action: ShortcutAction

The action that gets activated by this shortcut.

props.arguments: Variant

Arguments passed to activation.

props.trigger: ShortcutTrigger

The trigger that triggers this shortcut.