On 4 December 2013 03:25, Steven Blatnick steve8track@yahoo.com wrote:
For mapping a keyboard shortcut to an action, look for some code like this (see my pluginhttps://github.com/sblatnick/geany-plugins/blob/master/quick-line/src/quick-line.c ):
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);
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. To open the menu using a keybinding, I would look at manually calling the appropriate event (perhaps gtk-menu-popuphttps://developer.gnome.org/gtk3/3.4/GtkMenu.html#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
Note that Steve has *not* set a key for the binding. It is strongly recommended that plugins do not set keys by default since they don't know what bindings the user has set for other plugins or standard features. It is rude to stomp on other peoples bindings.
Cheers Lex
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 listDevel@lists.geany.orghttps://lists.geany.org/cgi-bin/mailman/listinfo/devel
Devel mailing listDevel@lists.geany.orghttps://lists.geany.org/cgi-bin/mailman/listinfo/devel
Devel mailing list Devel@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/devel