Basics
Guides
API Reference
Basics
Guides
API Reference
[21:7] extends: object
Describes a keyboard shortcut. It contains a description of how to trigger
the shortcut via a [class@Gtk.ShortcutTrigger] and a way to activate the
shortcut on a widget via a [class@Gtk.ShortcutAction]. The actual work is
usually done via [class@Gtk.ShortcutController], 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 GtkWidgets 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.
Shortcut (trigger = null, action = null)
Creates a new
GtkShortcutthat is triggered by @trigger and then activates @action.
trigger is The trigger that will trigger the shortcut.action is The action that will be activated upon triggering.toNativeHandle (Source)
Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from
fn.call(...), another generated wrapper exposinghandle(), or null. Returns null when the argument carries no pointer.
Source is the raw handle, raw buffer, wrapper, or null.A raw pointer carrier or null when no pointer is present.getLib ()
Returns the opened native library for this generated wrapper.
The opened native library.handle ()
Returns the wrapped NativeHandle.
The wrapped NativeHandle.isNull ()
Returns true when the wrapped handle is null.
A bool.describe ()
Returns a small string for debugging generated wrappers.
A string.asObject ()
Wraps this handle as
Object.
A Object object.getProperty (string Name)
Reads one generated property by name.
setProperty (string Name, Value)
Writes one generated property by name.
setAction (object Value)
The action that gets activated by this shortcut.
Value is the new property value.None.setArguments (object Value)
Arguments passed to activation.
Value is the new property value.None.setTrigger (object Value)
The trigger that triggers this shortcut.
Value is the new property value.None.get_action ()
Gets the action that is activated by this shortcut.
get_arguments ()
Gets the arguments that are passed when activating the shortcut.
get_trigger ()
Gets the trigger used to trigger @self.
set_action (object action)
Sets the new action for @self to be @action.
action is The new action. If the @action is %NULL, the nothing action will be used..None.set_arguments (object args)
Sets the arguments to pass when activating the shortcut.
args is arguments to pass when activating @self.None.set_trigger (object trigger)
Sets the new trigger for @self to be @trigger.
trigger is The new trigger. If the @trigger is %NULL, the never trigger will be used..None.[236:14] static extends: object
Generated metadata helpers for Shortcut class surfaces.
properties ()
Returns property metadata for
Shortcut.
A list.
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.