1.173 <GtkShortcut>

Class: <GtkShortcut>

It derives from <GObject>.

Describes a keyboard shortcut.

It contains a description of how to trigger the shortcut via a <GtkShortcutTrigger> and a way to activate the shortcut on a widget via a <GtkShortcutAction>.

The actual work is usually done via <GtkShortcutController>, which decides if and when to activate a shortcut. Using that controller directly however is rarely necessary as various higher level convenience APIs exist on <GtkWidget>s that make it easier to use shortcuts in GTK.

<GtkShortcut> does provide functionality to make it easy for users to work with shortcuts, either by providing informational strings for display purposes or by allowing shortcuts to be configured.

Properties

Property: shortcut:action self

The action that gets activated by this shortcut.

Its value is a <GtkShortcutAction>, or #f.

Set it with (set! (shortcut:action self) value).

Property: shortcut:arguments self

Arguments passed to activation.

Its value is a <GVariant>, or #f.

Set it with (set! (shortcut:arguments self) value).

Property: shortcut:trigger self

The trigger that triggers this shortcut.

Its value is a <GtkShortcutTrigger>, or #f.

Set it with (set! (shortcut:trigger self) value).

Procedures

Method: shortcut:get-action self ⇒ %return
Method: get-action self ⇒ %return

Gets the action that is activated by this shortcut.

self

Passed: a <GtkShortcut>.

a <GtkShortcut>

%return

Returned: a <GtkShortcutAction>, or #f.

the action

Method: shortcut:get-arguments self ⇒ %return
Method: get-arguments self ⇒ %return

Gets the arguments that are passed when activating the shortcut.

self

Passed: a <GtkShortcut>.

a <GtkShortcut>

%return

Returned: a <GVariant>, or #f.

the arguments

Method: shortcut:get-trigger self ⇒ %return
Method: get-trigger self ⇒ %return

Gets the trigger used to trigger self.

self

Passed: a <GtkShortcut>.

a <GtkShortcut>

%return

Returned: a <GtkShortcutTrigger>, or #f.

the trigger used

Procedure: shortcut:new [trigger] [action] ⇒ %return

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

trigger

Passed, or left out: a <GtkShortcutTrigger>, or #f.

The trigger that will trigger the shortcut

action

Passed, or left out: a <GtkShortcutAction>, or #f.

The action that will be activated upon triggering

%return

Returned: a <GtkShortcut>.

a new <GtkShortcut>

Method: shortcut:set-action self [action]
Method: set-action self [action]

Sets the new action for self to be action.

self

Passed: a <GtkShortcut>.

a <GtkShortcut>

action

Passed, or left out: a <GtkShortcutAction>, or #f.

The new action. If the action is #f, the nothing action will be used.

Method: shortcut:set-arguments self [args]
Method: set-arguments self [args]

Sets the arguments to pass when activating the shortcut.

self

Passed: a <GtkShortcut>.

a <GtkShortcut>

args

Passed, or left out: a <GVariant>, or #f.

arguments to pass when activating self

Method: shortcut:set-trigger self [trigger]
Method: set-trigger self [trigger]

Sets the new trigger for self to be trigger.

self

Passed: a <GtkShortcut>.

a <GtkShortcut>

trigger

Passed, or left out: a <GtkShortcutTrigger>, or #f.

The new trigger. If the trigger is #f, the never trigger will be used.