Creates a new shortcut controller.
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.
Removes shortcut from the list of shortcuts handled by self.
Sets the controller to use the given modifier for mnemonics.
Sets the controller to have the given scope.
Creates a new shortcut controller that takes its shortcuts from the given list model.
Get the item at position and cast to the template type. NOTE: If type is an interface and no known D object is found that the object conforms to, the interface IfaceProxy object will be used. If position is greater than the number of items in list, %NULL is returned. %NULL may be returned if index is smaller than the length of the list, but the object does not conform to the template type. This function is meant to be used by language bindings in place of Gio.ListModel.getItem. See also: Gio.ListModel.getNItems
Gets the type of the items in list.
Gets the number of items in list.
Get the item at position.
Emits the #GListModel::items-changed signal on list.
Connect to ItemsChanged signal.
Gets the ID of the buildable object.
Returns the event that is currently being handled by the controller.
Returns the device of the event that is currently being handled by the controller.
Returns the modifier state of the event that is currently being handled by the controller.
Returns the timestamp of the event that is currently being handled by the controller.
Gets the name of controller.
Gets the propagation limit of the event controller.
Gets the propagation phase at which controller handles events.
Returns the gtk.widget.Widget 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.
Sets a name on the controller that can be used for debugging.
Get the item at position and cast to the template type. NOTE: If type is an interface and no known D object is found that the object conforms to, the interface IfaceProxy object will be used. If position is greater than the number of items in list, %NULL is returned. %NULL may be returned if index is smaller than the length of the list, but the object does not conform to the template type. This function is meant to be used by language bindings in place of Gio.ListModel.getItem. See also: Gio.ListModel.getNItems
Gets the type of the items in list.
Gets the number of items in list.
Get the item at position.
Emits the #GListModel::items-changed signal on list.
Connect to ItemsChanged signal.
Gets the ID of the buildable object.
gtk.shortcut_controller.ShortcutController is an event controller that manages shortcuts.
Most common shortcuts are using this controller implicitly, e.g. by adding a mnemonic underline to a gtk.label.Label, or by installing a key binding using gtk.widget_class.WidgetClass.addBinding, or by adding accelerators to global actions using gtk.application.Application.setAccelsForAction.
But it is possible to create your own shortcut controller, and add shortcuts to it.
gtk.shortcut_controller.ShortcutController implements gio.list_model.ListModel for querying the shortcuts that have been added to it.
GtkShortcutController as GtkBuildable
gtk.shortcut_controller.ShortcutControllers can be created in gtk.builder.Builder ui files, to set up shortcuts in the same place as the widgets.
An example of a UI definition fragment with gtk.shortcut_controller.ShortcutController:
This example creates a gtk.activate_action.ActivateAction for triggering the activate signal of the gtk.button.Button. See gtk.shortcut_action.ShortcutAction.parseString for the syntax for other kinds of gtk.shortcut_action.ShortcutAction. See gtk.shortcut_trigger.ShortcutTrigger.parseString to learn more about the syntax for triggers.