Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Unified Diff: webkit/api/src/mac/WebInputEventFactory.mm

Issue 378019: Another attempt at fixing cmd-left/right. (Closed)
Patch Set: rebase tot Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/api/src/EditorClientImpl.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..d618228adee39d8b0ede4f20524b43db2f8dd851 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 |isSystemKey| if alt is down. WebKit looks at this
+ // flag 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 |isSystemKey| if alt is down. WebKit looks at this
+ // flag 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;
}
« no previous file with comments | « webkit/api/src/EditorClientImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698