[wxGTK 2.8.0] accelerators not working
notnot
notnot at xs4all.nl
Sat Feb 24 12:36:50 PST 2007
> Could you test of the code in src/gtk/window.cpp, lines 1040
> in CVS HEAD are reached at all? If you have any old version,
> just look for "#if wxUSE_ACCEL" and see of the code gets
> executed at all (and maybe see what's wrong),
Ok, I have inserted some stderr output in 2.8.0 window.cpp
gtk_window_key_press_callback() to see what is going on.
Indeed, a bare wxframe does not receive key strokes. After
adding a panel, gtk_window_key_press_callback() is executed
once for all alphanumerical key presses, and twice for the other
key presses, if the panel has focus.
All GTK key events pass wxTranslateGTKKeyEventToWx() and are
emitted as wxWidgets KEY_DOWN events. But at a later stage,
gtk_im_context_filter_keypress() intercepts all alphanumerical
keys, except when Ctrl or Alt is also pressed.
So the processing of a 'regular' key does not reach the point
where the acccelerator table is checked...
After seeing this I tried wxACCEL_CTRL and wxACCEL_ALT when
setting the accelerator table entries, and that actually
made the accelerators work in wxGTK :)
So I can narrow the 'accelerators' problem down to those with
wxACCEL_NORMAL and wxACCEL_SHIFT. How to make these pass the
GTK IM context filter?
I need some accelerator keys without any modifiers.
Erwin
More information about the wx-users
mailing list