I think it's pretty easy :)
You have to create your own class of each control you're using. Probably you're doing something like wxText * text = new wxText(this,-1) ... etc ...
This however will not be able to catch any events...
Now if you do this:
--h-- class MyTextControl : public wxText { // Do nothing (this means: take everything from above (in hierarchy: wxText) control
DECLARE_EVENT_TABLE(); }
--cpp-- BEGIN_EVENT_TABLE(MyTextControl, wxText) EVT_CHAR ( MyTextControl::On_KeyEvent ) END_EVENT_TABLE()
it could be evt_char_hook or evt_key_down too...
In this event you should use StopPropagating or something like that, which means .... "I have handled the event, beat it now!"
Do the same for every button, where you check the char-key you want to activate the button with & the space bar...
There could be another way, but that's how I should do it ;)
------------------------ Website: www.KaReLs0ft.be |