mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 06:11:37 +00:00
Bug 921299 - Don't consider all keypresses to be synthetic events on b2g (r=smaug)
This commit is contained in:
parent
039e7ab2b9
commit
055511bb01
@ -1242,7 +1242,9 @@ nsDOMWindowUtils::SendKeyEvent(const nsAString& aType,
|
||||
|
||||
event.refPoint.x = event.refPoint.y = 0;
|
||||
event.time = PR_IntervalNow();
|
||||
event.mFlags.mIsSynthesizedForTests = true;
|
||||
if (!(aAdditionalFlags & KEY_FLAG_NOT_SYNTHESIZED_FOR_TESTS)) {
|
||||
event.mFlags.mIsSynthesizedForTests = true;
|
||||
}
|
||||
|
||||
if (aAdditionalFlags & KEY_FLAG_PREVENT_DEFAULT) {
|
||||
event.mFlags.mDefaultPrevented = true;
|
||||
|
@ -508,17 +508,18 @@ let FormAssistant = {
|
||||
case "Forms:Input:SendKey":
|
||||
CompositionManager.endComposition('');
|
||||
|
||||
let flags = domWindowUtils.KEY_FLAG_NOT_SYNTHESIZED_FOR_TESTS;
|
||||
this._editing = true;
|
||||
let doKeypress = domWindowUtils.sendKeyEvent('keydown', json.keyCode,
|
||||
json.charCode, json.modifiers);
|
||||
json.charCode, json.modifiers, flags);
|
||||
if (doKeypress) {
|
||||
domWindowUtils.sendKeyEvent('keypress', json.keyCode,
|
||||
json.charCode, json.modifiers);
|
||||
json.charCode, json.modifiers, flags);
|
||||
}
|
||||
|
||||
if(!json.repeat) {
|
||||
domWindowUtils.sendKeyEvent('keyup', json.keyCode,
|
||||
json.charCode, json.modifiers);
|
||||
json.charCode, json.modifiers, flags);
|
||||
}
|
||||
|
||||
this._editing = false;
|
||||
|
@ -539,6 +539,10 @@ interface nsIDOMWindowUtils : nsISupports {
|
||||
// If this is set, preventDefault() the event before dispatch.
|
||||
const unsigned long KEY_FLAG_PREVENT_DEFAULT = 0x0001;
|
||||
|
||||
// If this is set, the mIsSynthesizedForTests flag is set to false
|
||||
// on the key event. Otherwise it is true.
|
||||
const unsigned long KEY_FLAG_NOT_SYNTHESIZED_FOR_TESTS = 0x0002;
|
||||
|
||||
// if one of these flags is set, the KeyboardEvent.location will be the value.
|
||||
// Otherwise, it will be computed from aKeyCode.
|
||||
const unsigned long KEY_FLAG_LOCATION_STANDARD = 0x0010;
|
||||
|
Loading…
Reference in New Issue
Block a user