How to make new menu item register with keyboard shortcut?

Discussion about CodeLite development process and patches
nghiaho12
CodeLite Curious
Posts: 2
Joined: Fri Jan 22, 2016 3:12 am
Genuine User: Yes
IDE Question: C++
Contact:

How to make new menu item register with keyboard shortcut?

Post by nghiaho12 »

Hi,

I'm trying to add some extra editing features under the "Edit" menu. The feature works but doesn't appear in Settings -> Keyboard Shortcuts. What do I have do to?

Nghia
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: How to make new menu item register with keyboard shortcu

Post by eranif »

You should edit the file

Code: Select all

Runtime/config/accelerators.conf.default
and add the new entry there, for example:

Code: Select all

ID_QUICK_ADD_NEXT|Search::Find and Replace|Quick Add Next|Ctrl-K
The line splitted into four, separated by '|'
The first part, is the menu entry ID (in the code, CodeLite uses it like this XRCID("ID_QUICK_ADD_NEXT")
The second part, the menu path. In this example, the menu entry is located under: Search->Find And Replace
The third part, is the menu entry name
The fourth path, is the keyboard shortcut

HTH,
Eran
Make sure you have read the HOW TO POST thread
nghiaho12
CodeLite Curious
Posts: 2
Joined: Fri Jan 22, 2016 3:12 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: How to make new menu item register with keyboard shortcu

Post by nghiaho12 »

Turns out I had to refresh the list by clicking the Defaults button for it to appear.
Post Reply