Basics
Guides
API Reference
Basics
Guides
API Reference
[19:7] extends: object
Tracks how a GtkShortcut can be activated. To find out if a
GtkShortcutTrigger triggers, you can call
[method@Gtk.ShortcutTrigger.trigger] on a GdkEvent. GtkShortcutTriggers
contain functions that allow easy presentation to end users as well as being
printed for debugging. All GtkShortcutTriggers are immutable, you can only
specify their properties during construction. If you want to change a
trigger, you have to replace it with a new one.
ShortcutTrigger (argString = null)
Tries to parse the given string into a trigger. On success, the parsed trigger is returned. When parsing failed, %NULL is returned. The accepted strings are: -
never, forGtkNeverTrigger- a string parsed by gtk_accelerator_parse(), for aGtkKeyvalTrigger, e.g.<Control>C- underscore, followed by a single character, forGtkMnemonicTrigger, e.g._l- two valid trigger strings, separated by a|character, for aGtkAlternativeTrigger:<Control>q|<Control>wNote that you will have to escape the<and>characters when specifying triggers in XML files, such as GtkBuilder ui files. Use<instead of<and>instead of>.
argString is the string to parse.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.compare (object trigger2)
The types of @trigger1 and @trigger2 are
gconstpointeronly to allow use of this function as aGCompareFunc. They must each be aGtkShortcutTrigger.
trigger2 is a GtkShortcutTrigger.equal (object trigger2)
Checks if @trigger1 and @trigger2 trigger under the same conditions. The types of @one and @two are
gconstpointeronly to allow use of this function withGHashTable. They must each be aGtkShortcutTrigger.
trigger2 is a GtkShortcutTrigger.hash ()
Generates a hash value for a
GtkShortcutTrigger. The output of this function is guaranteed to be the same for a given value only per-process. It may change between different processor architectures or even different versions of GTK. Do not use this function as a basis for building protocols or file formats. The types of @trigger isgconstpointeronly to allow use of this function withGHashTable. They must each be aGtkShortcutTrigger.
print (arg1String)
Prints the given trigger into a string for the developer. This is meant for debugging and logging. The form of the representation may change at any time and is not guaranteed to stay identical.
string is a GString to print into.None.print_label (object display, arg2String)
Prints the given trigger into a string. This function is returning a translated string for presentation to end users for example in menu items or in help texts. The @display in use may influence the resulting string in various forms, such as resolving hardware keycodes or by causing display-specific modifier names. The form of the representation may change at any time and is not guaranteed to stay identical.
display is GdkDisplay to print for.string is a GString to print into.to_label (object display)
Gets textual representation for the given trigger. This function is returning a translated string for presentation to end users for example in menu items or in help texts. The @display in use may influence the resulting string in various forms, such as resolving hardware keycodes or by causing display-specific modifier names. The form of the representation may change at any time and is not guaranteed to stay identical.
display is GdkDisplay to print for.to_string ()
Prints the given trigger into a human-readable string. This is a small wrapper around [method@Gtk.ShortcutTrigger.print] to help when debugging.
trigger (object event, bool enable_mnemonics)
Checks if the given @event triggers @self.
event is the event to check.enable_mnemonics is %TRUE if mnemonics should trigger. Usually the value of this property is determined by checking that the passed inis a Key event and has the right modifiers set..
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.