I have a menu containing several items, all with accelerator shortcuts defined using the tab character convenience method. Like this:
Code: Select all
Increase volume\tCtrl+Up
So far, I've worked out that I can intercept all keys before they're processed for accelerator usage by binding a handler for wxEVT_CHAR_HOOK. But I'm not quite sure how to precede from that point. I want to define a set of shortcuts that should be passed through to the TextCtrl, but allow other accelerators to be processed normally if they don't have a TextCtrl-specific function. For instance, Ctrl+Left and Ctrl+Right should be processed by the TextCtrl because they navigate by word, but Ctrl+O should trigger its associated menu command because the TextCtrl has no use for that particular shortcut.
Changing the shortcuts (e.g. to Alt+Left instead of Ctrl+Left) isn't an option here as the application allows the users to interactively change the accelerators. Disabling the problematic menu items when a TextCtrl has focus also won't work, because the associated accelerator shortcuts still don't carry out their intended functions inside the TextCtrl (i.e. disabling the menu item with accelerator Ctrl+Left doesn't magically make the TextCtrl process that key combination properly). The latter point seems like a bug in wx, but it is how it is.
Hopefully I've made myself clear enough, and I appreciate any help anyone can give on this.