Page 1 of 1

Add to Shortcut menu with custom plugin

Posted: Mon Jan 21, 2013 7:10 am
by caibbor
I'm not sure where else to post this, so this section seems appropriate.

I've just finished making a plugin for CodeLite and I'm trying to figure out how to make a shortcut for it. I've searched the source for terms like "shortcut" and the plugins code doesn't even seem to do anything special. my plugin doesn't just show up in the keyboard shortcuts dialog automatically, so I'm not sure what to do.

Re: Add to Shortcut menu with custom plugin

Posted: Tue Jan 22, 2013 11:54 am
by caibbor
after some more digging, it turns out keyboard shortcuts in CodeLite are called "Accelerators"

and they're stored in ~/.config/accelerators.conf

Adding a line is done manually, and manually only, I guess. doing so works.

Re: Add to Shortcut menu with custom plugin

Posted: Tue Jan 22, 2013 12:59 pm
by eranif
caibbor wrote:after some more digging, it turns out keyboard shortcuts in CodeLite are called "Accelerators"

and they're stored in ~/.config/accelerators.conf

Adding a line is done manually, and manually only, I guess. doing so works.

This is not the correct place for doing this. As this is a user settings which codelite writes into it
Note that overriding your change can easily be done from the UI by clicking on:
Settings -> Keyboard Shortcuts -> Defaults button

The correct way of this it is by making a new file named:

Code: Select all

<my-plugin>.accelerators


and place it under (Linux):

Code: Select all

/usr/lib/codelite/resources/
And in Windows it should be placed under:

Code: Select all

CODELITE_INSTALL_DIRECTORY\Plugins\resources
When codelite starts up, it will load this file along with other 'accelerators' files from that directory
Eran