Bug 831144 - Properly pass meta states to Gecko; r=cpeterson

This commit is contained in:
Jim Chen 2013-03-05 11:07:51 +00:00
parent 9c7a020058
commit 02ee1b5198
2 changed files with 8 additions and 2 deletions

View File

@ -194,6 +194,10 @@ public class GeckoEvent {
mFlags = k.getFlags();
mKeyCode = k.getKeyCode();
mUnicodeChar = k.getUnicodeChar();
if (mUnicodeChar == 0) {
// e.g. for Ctrl+A, Android returns 0, but Gecko expects 'a' as mUnicodeChar
mUnicodeChar = k.getUnicodeChar(0);
}
mRepeatCount = k.getRepeatCount();
mCharacters = k.getCharacters();
mDomKeyLocation = isJoystickButton(mKeyCode) ? DOM_KEY_LOCATION_JOYSTICK : DOM_KEY_LOCATION_MOBILE;

View File

@ -1511,10 +1511,10 @@ nsWindow::InitKeyEvent(nsKeyEvent& event, AndroidGeckoEvent& key,
event.pluginEvent = pluginEvent;
}
event.InitBasicModifiers(gMenu,
event.InitBasicModifiers(gMenu || key.IsCtrlPressed(),
key.IsAltPressed(),
key.IsShiftPressed(),
false);
key.IsMetaPressed());
event.location = key.DomKeyLocation();
event.time = key.Time();
@ -1608,6 +1608,8 @@ nsWindow::OnKeyEvent(AndroidGeckoEvent *ae)
case AndroidKeyEvent::KEYCODE_SHIFT_RIGHT:
case AndroidKeyEvent::KEYCODE_ALT_LEFT:
case AndroidKeyEvent::KEYCODE_ALT_RIGHT:
case AndroidKeyEvent::KEYCODE_CTRL_LEFT:
case AndroidKeyEvent::KEYCODE_CTRL_RIGHT:
firePress = false;
break;
case AndroidKeyEvent::KEYCODE_BACK: