I just looked at src/gtk/window.cpp and found this snippet:
// Implement OnCharHook by checking ancestor top level windows wxWindow *parent = win; while (parent && !parent->IsTopLevel()) parent = parent->GetParent(); if (parent) { event.SetEventType( wxEVT_CHAR_HOOK ); ret = parent->HandleWindowEvent( event ); } if (!ret) { event.SetEventType(wxEVT_CHAR); ret = win->HandleWindowEvent( event ); }
So, maybe you just need to return false from the OnCharHook event OnCharHook ?
According to one of the wx mailing list messages:
If you want the frame to catch all char events, use EVT_CHAR_HOOK, otherwise events will be sent to children. If you want to catch things like escape, you need to set the wxWANTS_CHARS flag to the frame. Also, make sure you call event.Skip () for characters that you are not processing.
But another post:
... do not use EVT_CHAR_HOOK (), it is a hack. In addition, this is a hacked Windows file and I personally am not at all interested in getting it to work correctly. If anything, I would like to give it up and completely get rid of it. Vz.
This post may interest you .
source share