GNOME Bugzilla – Bug 337096
easy way to provide additional shortcut for an action
Last modified: 2014-05-22 01:19:44 UTC
Currently, if you want to add another key shortcut for an action, you have to add *another* GtkAction which activates the same callback, and add an <accelerator> to your UI file. That's rather wasteful: - the extra GtkAction:s take memory, and - you need to set the sensitivity of the extra actions in addition to the one of the 'main' action, as to not allow activation of the callback from the alternative shortcut I'd like to have a way to just add another shortcut to an existing action by specifying the keycode like in the GtkActionEntry structure. Unfortunately the gtk key format isn't very suitable for use in the XML UI file, since you need to escape the <>'s... maybe there could be an alternative format added which uses a different delimiter? Something like this: <shortcut action="GoLeft" key="[Alt]KP_Left" />
this is possible now, with gtk_application_set_accels_for_action