Index: webkit/api/src/mac/WebInputEventFactory.mm |
diff --git a/webkit/api/src/mac/WebInputEventFactory.mm b/webkit/api/src/mac/WebInputEventFactory.mm |
index 74a7a8713a9c89b4a654b2539cc020ecea375260..5f29c50f7c5627f9c789527e4d18d38f0296da1f 100644 |
--- a/webkit/api/src/mac/WebInputEventFactory.mm |
+++ b/webkit/api/src/mac/WebInputEventFactory.mm |
@@ -919,6 +919,14 @@ WebKeyboardEvent WebInputEventFactory::keyboardEvent(NSEvent* event) |
result.timeStampSeconds = [event timestamp]; |
+ // Windows and Linux set that if alt is down. WebKit looks at this to decide |
+ // if it should handle a key or not. E.g. alt-left/right shouldn't be used |
+ // by webkit to scroll the current page, because we want to get that key |
+ // back for it to do history navigation. Hence, the corresponding situation |
+ // on OS X is to set this for cmd key presses. |
+ if (result.modifiers & WebInputEvent::MetaKey) |
+ result.isSystemKey = true; |
+ |
return result; |
} |
@@ -938,6 +946,15 @@ WebKeyboardEvent WebInputEventFactory::keyboardEvent(wchar_t character, |
result.nativeKeyCode = character; |
result.text[0] = character; |
result.unmodifiedText[0] = character; |
+ |
+ // Windows and Linux set that if alt is down. WebKit looks at this to decide |
+ // if it should handle a key or not. E.g. alt-left/right shouldn't be used |
+ // by webkit to scroll the current page, because we want to get that key |
+ // back for it to do history navigation. Hence, the corresponding situation |
+ // on OS X is to set this for cmd key presses. |
+ if (result.modifiers & WebInputEvent::MetaKey) |
+ result.isSystemKey = true; |
+ |
return result; |
} |