### Class

# Gtk Shortcut

since: 4.0

#### Description [src]

    final class Gtk.Shortcut : GObject.Object
    {
      /* No available fields */
    }

A `GtkShortcut` 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.

Available since: 4.0

#### Ancestors

- GObject

#### Constructors

###### gtk_shortcut_new

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

since: 4.0

###### gtk_shortcut_new_with_arguments

Creates a new `GtkShortcut` that is triggered by `trigger` and then activates `action` with arguments given by `format_string`.

since: 4.0

#### Instance methods

###### gtk_shortcut_get_action

Gets the action that is activated by this shortcut.

since: 4.0

###### gtk_shortcut_get_arguments

Gets the arguments that are passed when activating the shortcut.

since: 4.0

###### gtk_shortcut_get_trigger

Gets the trigger used to trigger `self`.

since: 4.0

###### gtk_shortcut_set_action

Sets the new action for `self` to be `action`.

since: 4.0

###### gtk_shortcut_set_arguments

Sets the arguments to pass when activating the shortcut.

since: 4.0

###### gtk_shortcut_set_trigger

Sets the new trigger for `self` to be `trigger`.

since: 4.0

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

#### Properties

###### Gtk.Shortcut:action

The action that gets activated by this shortcut.

since: 4.0

###### Gtk.Shortcut:arguments

Arguments passed to activation.

since: 4.0

###### Gtk.Shortcut:trigger

The trigger that triggers this shortcut.

since: 4.0

#### Signals

##### Signals inherited from GObject (1)

###### GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

since: 2.0

#### Class structure

    struct GtkShortcutClass {
      GObjectClass parent_class;

    }

No description available.

###### Class members

`parent_class: GObjectClass`
  No description available.