User forums > General (but related to Code::Blocks)
Changing keyboard shortcuts?
takeshimiya:
Here's my duplicate of the RFE: http://sourceforge.net/tracker/index.php?func=detail&aid=1201652&group_id=126998&atid=707419
If you want to know where to start, there is a project in wxCode called Keybinder (using wxWidgets) with the only purpose of adding keyboard shortcuts to your program.
Please look here http://wxcode.sourceforge.net/components/keybinder/
thomas:
Looks interesting, that one (though the site showed me a 404, but google had it cached). Wonder how hard it is to incorporate, as it seems you need to modify your wxApp and it uses a lot of custom stuff, too. Do you have experience using it?
On a different thought, it would be great if this could be wrapped into a plugin instead. Then it should not be too hard to do it without changing anything to the main program.
If only I knew how to get keyboard events from inside a plugin... EVT_KEY_DOWN and EVT_CHAR don't do.
Plugins have access to the menu bar, so one could read out the elements, their titles and their repective message IDs, display the titles in a list and have the user assign keys to them. Save that in a std::map, and when a key event comes in, post a menu event instead.
Sounds easy enough, except I have no clue how to get to a key event when the message is not handed down.
mandrav:
This is the component we plan on using (when time permits ;) ).
It will be bound between the SDK and the main app (somehow) and the SDK will provide some additional functions for the plugins to call. Something along the lines of:
--- Code: ---RegisterKeyboardShortcut(int id, const wxString& shortcut);
UnregisterKeyboardShortcutFor(int id);
--- End code ---
But we don't have time for this until after 1.0 is released. If anyone wants to tackle this and provide a patch, he is welcome to do so ;)
Navigation
[0] Message Index
[*] Previous page
Go to full version