Sets our main struct and passes it to the parent class.
Creates a new shortcut controller.
Creates a new shortcut controller that takes its shortcuts from the given list model.
Adds @shortcut to the list of shortcuts handled by @self.
Gets the mnemonics modifiers for when this controller activates its shortcuts.
Gets the scope for when this controller activates its shortcuts. See gtk_shortcut_controller_set_scope() for details.
Get the main Gtk struct
the main Gtk struct as a void*
Removes @shortcut from the list of shortcuts handled by @self.
Sets the controller to have the given @mnemonics_modifiers.
Sets the controller to have the given @scope.
the main Gtk struct
the main Gtk struct
Get the main Gtk struct
the main Gtk struct as a void*
Returns the event that is currently being handled by the controller, and %NULL at other times.
Returns the device of the event that is currently being handled by the controller, and %NULL otherwise.
Returns the modifier state of the event that is currently being handled by the controller, and 0 otherwise.
Returns the timestamp of the event that is currently being handled by the controller, and 0 otherwise.
Gets the name of @controller.
Gets the propagation limit of the event controller.
Gets the propagation phase at which @controller handles events.
Returns the #GtkWidget this controller relates to.
Resets the @controller to a clean state.
Sets a name on the controller that can be used for debugging.
Sets the event propagation limit on the event controller.
Sets the propagation phase at which a controller handles events.
Get the main Gtk struct
the main Gtk struct as a void*
Get the item at @position. If @position is greater than the number of items in @list, %NULL is returned.
Gets the type of the items in @list. All items returned from g_list_model_get_type() are of that type or a subtype, or are an implementation of that interface.
Gets the number of items in @list.
Get the item at @position. If @position is greater than the number of items in @list, %NULL is returned.
Emits the #GListModel::items-changed signal on @list.
This signal is emitted whenever items were added to or removed from @list. At @position, @removed items were removed and @added items were added in their place.
Get the main Gtk struct
the main Gtk struct as a void*
Gets the ID of the @buildable object.
GtkShortcutController is an event controller that manages shortcuts.
Most common shortcuts are using this controller implicitly, e.g. by adding a mnemonic underline to a GtkLabel, or by installing a key binding using gtk_widget_class_add_binding(), or by adding accelerators to global actions using gtk_application_set_accels_for_action().
But it is possible to create your own shortcut controller, and add shortcuts to it.
GtkShortcutController implements GListModel for querying the shortcuts that have been added to it.
GtkShortcutController as a GtkBuildable
GtkShortcutControllers can be creates in ui files to set up shortcuts in the same place as the widgets.
An example of a UI definition fragment with GtkShortcutController:
This example creates a [class@Gtk.ActivateAction] for triggering the activate signal of the GtkButton. See [ctor@Gtk.ShortcutAction.parse_string] for the syntax for other kinds of GtkShortcutAction. See [ctor@Gtk.ShortcutTrigger.parse_string] to learn more about the syntax for triggers.