<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Thank you. It work fine. I've used this project (
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<a
href="https://github.com/geany/geany-plugins/tree/master/geanylipsum">https://github.com/geany/geany-plugins/tree/master/geanylipsum</a>)
as example because the code is more simple to read for a noob like
me :)<br>
<br>
Than you all!!! :)<br>
<br>
Good job!<br>
<br>
<div class="moz-cite-prefix">Il 03/12/2013 17:25, Steven Blatnick ha
scritto:<br>
</div>
<blockquote cite="mid:529E0605.40209@yahoo.com" type="cite">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
For mapping a keyboard shortcut to an action, look for some code
like this (see <a moz-do-not-send="true"
href="https://github.com/sblatnick/geany-plugins/blob/master/quick-line/src/quick-line.c">my
plugin</a>):<br>
<blockquote>
<div class="line" id="LC80"><font face="Courier New, Courier,
monospace"><span class="n">GeanyKeyGroup</span> <span
class="o">*</span><span class="n">key_group</span><span
class="p">;</span></font></div>
<div class="line" id="LC82"><font face="Courier New, Courier,
monospace"><span class="n">key_group</span> <span class="o">=</span>
<span class="n">plugin_set_key_group</span><span class="p">(</span><span
class="n">geany_plugin</span><span class="p">,</span> <span
class="s">"quick_line_keyboard_shortcut"</span><span
class="p">,</span> <span class="n">KB_GROUP</span><span
class="p">,</span> <span class="nb">NULL</span><span
class="p">);</span></font></div>
<div class="line" id="LC84"><font face="Courier New, Courier,
monospace"><span class="n">keybindings_set_item</span><span
class="p">(</span><span class="n">key_group</span><span
class="p">,</span> <span class="n">KB_QUICK_LINE</span><span
class="p">,</span> <span class="n">quick_line</span><span
class="p">,</span> <span class="mi">0</span><span
class="p">,</span> <span class="mi">0</span><span
class="p">,</span><span class="s"> "quick_line"</span><span
class="p">,</span> <span class="n">_</span><span
class="p">(</span><span class="s">"Quick Line..."</span><span
class="p">),</span> <span class="nb">NULL</span><span
class="p">);</span></font></div>
</blockquote>
Each call to <font face="Courier New, Courier, monospace"><span
class="n">keybindings_set_item</span><span class="p"></span></font>
adds an entry in the Preferences->Keybindings for you to map
any way that you or others using your plugin want to.<br>
To open the menu using a keybinding, I would look at manually
calling the appropriate event (perhaps <a moz-do-not-send="true"
href="https://developer.gnome.org/gtk3/3.4/GtkMenu.html#gtk-menu-popup">gtk-menu-popup</a>)
from within the callback you set up in the keybindings_set_item.
In the code above, <font face="Courier New, Courier, monospace">quick_line</font>
is the callback.<br>
<br>
I hope this helps.<br>
<br>
Steve<br>
<br>
<div class="moz-cite-prefix">On 12/03/2013 09:10 AM, Francesco
OpenCode Apruzzese wrote:<br>
</div>
<blockquote cite="mid:529E026D.9090505@e-ware.org" type="cite">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
Yes. Sorry.<br>
<br>
I've developed this plugin: <a moz-do-not-send="true"
class="moz-txt-link-freetext"
href="https://github.com/OpenCode/geany-python-good-code">https://github.com/OpenCode/geany-python-good-code</a><br>
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<br>
<div class="moz-cite-prefix"><br>
Il 03/12/2013 16:28, Frank Lanitz ha scritto:<br>
</div>
<blockquote cite="mid:529DF8AF.4050005@frank.uvena.de"
type="cite">
<pre wrap="">Am 03.12.2013 15:39, schrieb Francesco OpenCode Apruzzese:
</pre>
<blockquote type="cite">
<pre wrap="">Hi all,
It's possible to associate a shortcut to a menu item created by a plugin?
</pre>
</blockquote>
<pre wrap="">Yes, it's possible. Can you go a little deeper?
Cheers,
Frank
</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Devel mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:Devel@lists.geany.org">Devel@lists.geany.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="https://lists.geany.org/cgi-bin/mailman/listinfo/devel">https://lists.geany.org/cgi-bin/mailman/listinfo/devel</a>
</pre>
</blockquote>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Devel mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:Devel@lists.geany.org">Devel@lists.geany.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="https://lists.geany.org/cgi-bin/mailman/listinfo/devel">https://lists.geany.org/cgi-bin/mailman/listinfo/devel</a>
</pre>
</blockquote>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Devel@lists.geany.org">Devel@lists.geany.org</a>
<a class="moz-txt-link-freetext" href="https://lists.geany.org/cgi-bin/mailman/listinfo/devel">https://lists.geany.org/cgi-bin/mailman/listinfo/devel</a>
</pre>
</blockquote>
<br>
</body>
</html>