After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 337096 - easy way to provide additional shortcut for an action
easy way to provide additional shortcut for an action
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Class: UIManager / Actions
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2006-04-03 21:33 UTC by Christian Persch
Modified: 2014-05-22 01:19 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Christian Persch 2006-04-03 21:33:35 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" />
Comment 1 Matthias Clasen 2014-05-22 01:19:44 UTC
this is possible now, with gtk_application_set_accels_for_action