Вот здесь описание бага: https://bugzilla.mozilla.org/show_bug.cgi?id=69230
Ниже патч, устраняющий проблему.
Код:
--- widget/src/gtk2/nsWindow.cpp.orig 2007-06-02 13:17:19.000000000 +0300
+++ widget/src/gtk2/nsWindow.cpp 2007-06-02 14:33:00.000000000 +0300
@@ -1880,38 +1880,33 @@ nsWindow::OnKeyPressEvent(GtkWidget *aWi
event.charCode = nsConvertCharCodeToUnicode(aEvent);
if (event.charCode) {
event.keyCode = 0;
- // if the control, meta, or alt key is down, then we should leave
- // the isShift flag alone (probably not a printable character)
- // if none of the other modifier keys are pressed then we need to
- // clear isShift so the character can be inserted in the editor
+ // handle special key sequences
if (event.isControl || event.isAlt || event.isMeta) {
- // make Ctrl+uppercase functional as same as Ctrl+lowercase
- // when Ctrl+uppercase(eg.Ctrl+C) is pressed,convert the charCode
- // from uppercase to lowercase(eg.Ctrl+c),so do Alt and Meta Key
- // It is hack code for bug 61355, there is same code snip for
- // Windows platform in widget/src/windows/nsWindow.cpp: See bug 16486
- // Note: if Shift is pressed at the same time, do not to_lower()
- // Because Ctrl+Shift has different function with Ctrl
- if (!event.isShift &&
- event.charCode >= GDK_A &&
- event.charCode <= GDK_Z)
- event.charCode = gdk_keyval_to_lower(event.charCode);
-
- // Keep the characters unshifted for shortcuts and accesskeys and
- // make sure that numbers are always passed as such (among others:
- // bugs 50255 and 351310)
- if (!event.isControl && event.isShift &&
- (event.charCode < GDK_0 || event.charCode > GDK_9)) {
- GdkKeymapKey k = { aEvent->hardware_keycode, aEvent->group, 0 };
- guint savedKeyval = aEvent->keyval;
- aEvent->keyval = gdk_keymap_lookup_key(gdk_keymap_get_default(), &k);
- PRUint32 unshiftedCharCode = nsConvertCharCodeToUnicode(aEvent);
- if (unshiftedCharCode)
- event.charCode = unshiftedCharCode;
- else
- aEvent->keyval = savedKeyval;
- }
+ // we want to get the same keyval regardless of the current layout
+ // or caps lock setting, so get the keyval for the hardware key
+ // that would have resulted if group 0, level 0 was in effect
+ GdkKeymapKey k = {
+ aEvent->hardware_keycode, /* group */ 0, /* level */ 0
+ };
+ guint savedKeyval = aEvent->keyval;
+ aEvent->keyval = gdk_keymap_lookup_key(gdk_keymap_get_default(), &k);
+
+ // looks like Mozilla expects key combinations with Shift to have
+ // an uppercase keyval, so try to convert the key if Shift is
+ // pressed.
+ if (event.isShift) {
+ aEvent->keyval = gdk_keyval_to_upper(aEvent->keyval);
+ }
+
+ PRUint32 unshiftedCharCode = nsConvertCharCodeToUnicode(aEvent);
+ if (unshiftedCharCode) {
+ event.charCode = unshiftedCharCode;
+ } else {
+ // couldn't convert the modified character to unicode, fall
+ // back to the original keyval
+ aEvent->keyval = savedKeyval;
+ }
}
}
Подскажите как его нужно устанавливать.
