file: shortcutcontroller.aus

class: ShortcutControllerCtors

[264:14] static extends: object

Alternate constructors for ShortcutController. Usage: ShortcutControllerCtors.<name>(...). The primary constructor lives directly on ShortcutController.

Methods

class: ShortcutController

[33:7] extends: object

Manages keyboard shortcuts and their activation. Most common shortcuts are using this controller implicitly, e.g. by adding a mnemonic underline to a [class@Gtk.Label], or by installing a key binding using [method@Gtk.WidgetClass.add_binding], or by adding accelerators to global actions using [method@Gtk.Application.set_accels_for_action]. But it is possible to create your own shortcut controller, and add shortcuts to it. GtkShortcutController implements [iface@Gio.ListModel] for querying the shortcuts that have been added to it. # GtkShortcutController as GtkBuildable GtkShortcutControllers can be created in [class@Gtk.Builder] ui files, to set up shortcuts in the same place as the widgets. An example of a UI definition fragment with GtkShortcutController: xml <object class='GtkButton'> <child> <object class='GtkShortcutController'> <property name='scope'>managed</property> <child> <object class='GtkShortcut'> <property name='trigger'>&lt;Control&gt;k</property> <property name='action'>activate</property> </object> </child> </object> </child> </object> This example creates a [class@Gtk.ActivateAction] for triggering the activate signal of the [class@Gtk.Button]. See [ctor@Gtk.ShortcutAction.parse_string] for the syntax for other kinds of [class@Gtk.ShortcutAction]. See [ctor@Gtk.ShortcutTrigger.parse_string] to learn more about the syntax for triggers.

Members

Methods

class: ShortcutControllerMeta

[284:14] static extends: object

Generated metadata helpers for ShortcutController class surfaces.

Methods