Application.addAccelerator

void addAccelerator(string accelerator, string actionName, glib.variant.Variant parameter = null)

Installs an accelerator that will cause the named action to be activated when the key combination specificed by accelerator is pressed.

accelerator must be a string that can be parsed by [gtk.global.acceleratorParse], e.g. "<Primary>q" or “<Control><Alt>p”.

action_name must be the name of an action as it would be used in the app menu, i.e. actions that have been added to the application are referred to with an “app.” prefix, and window-specific actions with a “win.” prefix.

GtkApplication also extracts accelerators out of “accel” attributes in the #GMenuModels passed to [gtk.application.Application.setAppMenu] and [gtk.application.Application.setMenubar], which is usually more convenient than calling this function for each accelerator.

Parameters

acceleratoraccelerator string
actionNamethe name of the action to activate
parameterparameter to pass when activating the action, or null if the action does not accept an activation parameter

Deprecated

Use [gtk.application.Application.setAccelsForAction] instead