For mapping a keyboard shortcut to an action, look for some code like this (see my plugin):
Each call to keybindings_set_item adds an entry in the Preferences->Keybindings for you to map any way that you or others using your plugin want to.GeanyKeyGroup *key_group;key_group = plugin_set_key_group(geany_plugin, "quick_line_keyboard_shortcut", KB_GROUP, NULL);keybindings_set_item(key_group, KB_QUICK_LINE, quick_line, 0, 0, "quick_line", _("Quick Line..."), NULL);
To open the menu using a keybinding, I would look at manually calling the appropriate event (perhaps gtk-menu-popup) from within the callback you set up in the keybindings_set_item. In the code above, quick_line is the callback.
I hope this helps.
Steve
On 12/03/2013 09:10 AM, Francesco OpenCode Apruzzese wrote:
Yes. Sorry.
I've developed this plugin: https://github.com/OpenCode/geany-python-good-code
I want to call the menu (my menu) "Python Good Code" with a shortcut like CTRL+SOME_CHAR or ALT+SOME_CHAR or key like F1-F12
Il 03/12/2013 16:28, Frank Lanitz ha scritto:
Am 03.12.2013 15:39, schrieb Francesco OpenCode Apruzzese:Hi all, It's possible to associate a shortcut to a menu item created by a plugin?Yes, it's possible. Can you go a little deeper? Cheers, Frank
_______________________________________________ Devel mailing list Devel@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/devel
_______________________________________________ Devel mailing list Devel@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/devel
_______________________________________________
Devel mailing list
Devel@lists.geany.org
https://lists.geany.org/cgi-bin/mailman/listinfo/devel