linux gtk2 seamonkey trunk, checkout finish: So Sep 18 22:29:45 CEST 2005 Typing in the location bar shows a lot of: WARNING: GetCharCode used for wrong key event; should use onkeypress., file ../../../../../mozilla/content/events/src/nsDOMKeyboardEvent.cpp, line 108
(cc'ing dbaron since this is also seen in the layout debugger. but might this be an issue in the <textbox> xbl binding?)
I think the gtk2 native keybinding code calls GetCharCode on all key events.
-> widget:gtk2 then, I guess.
It seems the problem is that in nsXBLWindowKeyHandler::WalkHandlers we unconditinally call nsDOMKeyboardEvent::GetCharCode if we have a nsINativeKeyBindings impl (which only GTK2 has, AFAIK). 1: <http://lxr.mozilla.org/seamonkey/source/content/xbl/src/nsXBLWindowKeyHandler.cpp#198>
See also http://lxr.mozilla.org/mozilla/source/layout/forms/nsTextControlFrame.cpp#393 . What's the right solution here? Should these two places only call GetCharCode in certain cases?
(In reply to comment #4) >http://lxr.mozilla.org/seamonkey/source/content/xbl/src/nsXBLWindowKeyHandler.cpp#198 This should probably check for aEventType == nsXBLAtoms::keypress first. I'm not sure what the best fix for nsTextControlFrame is offhand.
DOMEventToNativeKeyEvent is only used in nsTextControlFrame.cpp (in nsTextInputListener::KeyDown, ::KeyPress, ::KeyUp), so the method signature for DOMEventToNativeKeyEvent could easily be changed to take aEventType as well, for example.
Ginn Chen, I bet this is the bug you want to fix instead of making the change you made in bug 295228.
Created attachment 214505 [details] [diff] [review] draft for xbl
12 years ago
Comment on attachment 214505 [details] [diff] [review] draft for xbl mozilla/content/xbl/src/nsXBLWindowKeyHandler.cpp 1.30
This caused bug 330133...
This is only partly fixed. The code in DOMEventToNativeKeyEvent() (see comment 5, comment 7) still spews warnings to the console.
Created attachment 220215 [details] [diff] [review] Brutal hack This isn't the cleanest way to do this, but it works.