Bug 429510 Web apps cannot handle Ctrl+foo/Alt+foo key on keypress event, gtk2 part r=karl, sr=roc, a=beltzner
git-svn-id: svn://10.0.0.236/trunk@251243 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
b9ab808134
commit
d450ae5fc8
@ -2456,6 +2456,9 @@ nsWindow::OnKeyPressEvent(GtkWidget *aWidget, GdkEventKey *aEvent)
|
||||
g_free(keys);
|
||||
}
|
||||
if (minGroup >= 0) {
|
||||
PRUint32 unmodifiedCh =
|
||||
event.isShift ? altCharCodes.mShiftedCharCode :
|
||||
altCharCodes.mUnshiftedCharCode;
|
||||
// unshifted charcode of found keyboard layout.
|
||||
PRUint32 ch =
|
||||
GetCharCodeFor(aEvent, baseState, minGroup);
|
||||
@ -2470,6 +2473,17 @@ nsWindow::OnKeyPressEvent(GtkWidget *aWidget, GdkEventKey *aEvent)
|
||||
altCharCodes.mShiftedCharCode) {
|
||||
event.alternativeCharCodes.AppendElement(altCharCodes);
|
||||
}
|
||||
// If the charCode is not Latin, and the level is 0 or 1,
|
||||
// we should replace the charCode to Latin char if Alt and
|
||||
// Meta keys are not pressed. (Alt should be sent the
|
||||
// localized char for accesskey like handling of Web
|
||||
// Applications.)
|
||||
ch = event.isShift ? altCharCodes.mShiftedCharCode :
|
||||
altCharCodes.mUnshiftedCharCode;
|
||||
if (ch && !(event.isAlt || event.isMeta) &&
|
||||
event.charCode == unmodifiedCh) {
|
||||
event.charCode = ch;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user