<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    The shortcut code would look something like this:<br>
    <blockquote><font face="Courier New, Courier, monospace">    enum<br>
            {<br>
                KB_PLUGIN,<br>
                KB_GROUP<br>
            };<br>
        ...<br>
            key_group = plugin_set_key_group(geany_plugin,
        "plugin_name_keyboard_shortcut", KB_GROUP, NULL);<br>
            keybindings_set_item(key_group, KB_PLUGIN,
        shortcut_callback, 0, 0,<br>
                "plugin_name", _("Shortcut Name"), NULL);</font><br>
    </blockquote>
    Here is a simple plugin that uses that structure:<br>
        <a
href="https://github.com/sblatnick/geany-plugins/blob/quick-search/quick-search/src/quick-search.c">https://github.com/sblatnick/geany-plugins/blob/quick-search/quick-search/src/quick-search.c</a><br>
    Here is another plugin that allows dynamically adding shortcuts (as
    opposed to a fixed number):<br>
        <a
href="https://github.com/sblatnick/geany-plugins/blob/external-tools/external-tools/src/tool.c">https://github.com/sblatnick/geany-plugins/blob/external-tools/external-tools/src/tool.c</a>
    line 64<br>
    <br>
    I hope this helps,<br>
    <br>
    Steve<br>
    <br>
    <div class="moz-cite-prefix">On 03/25/2014 05:12 PM, Lex Trotman
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAKhWKDPMT7d+aaLycFRphUGv3q7SuKO8eA7xNmuE7B6+2m173w@mail.gmail.com"
      type="cite">
      <pre wrap="">On 26 March 2014 09:33, Shankhoneer Chakrovarty <a class="moz-txt-link-rfc2396E" href="mailto:shankhoneer@gmail.com"><shankhoneer@gmail.com></a> wrote:
</pre>
      <blockquote type="cite">
        <pre wrap="">Hi,

'shiftcolumn' is one of the orphaned plugin which I have decided to work on.
shiftcolumn's default shortcut key to move the selected text to right is
<Primary>0 which conflicts with "Zoom reset", making the plugin useless to
move the text right unless for every move the user clicks Tools->Shift
Right. Shift left is done by <Primary>9 key which is working fine.

Also, this plugin doesnt have its plugin preferences dialog box.

I was planning to change the default shortcut key for the aforementioned
behavior of the plugin to <Primary>8 which AFAIK doesnt conflict with
anything.

Do you guys think its a good idea? What should I do to prevent such problems
to arise in future?
</pre>
      </blockquote>
      <pre wrap="">
It is actually preferable that plugins do not have default keybindings.

It is not known what combination plugins will be loaded and so it is
not known what combination of keybindings might clash, and it is not
known what keybindings a user might define themselves that can clash.

So I would recommend that default keybindings be removed from plugins.

Cheers
Lex

</pre>
      <blockquote type="cite">
        <pre wrap="">
Thanks,
Shankhoneer Chakrovarty

_______________________________________________
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>
      <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>