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

Unified Diff: Source/web/WebInputEventFactoryMac.mm

Issue 1215633003: Fix false negatives in system key events recognition (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add test Created 5 years, 3 months 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 | « no previous file | Source/web/tests/WebInputEventFactoryTestMac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebInputEventFactoryMac.mm
diff --git a/Source/web/WebInputEventFactoryMac.mm b/Source/web/WebInputEventFactoryMac.mm
index a455bbab6e458acff8363ec5dee31b9d2fd6a135..7bca7e0ba799e1c8d9a087f47bd38f880383ea16 100644
--- a/Source/web/WebInputEventFactoryMac.mm
+++ b/Source/web/WebInputEventFactoryMac.mm
@@ -823,11 +823,16 @@ bool WebInputEventFactory::isSystemKeyEvent(const WebKeyboardEvent& event)
// shouldn't be used by Blink 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.
+
// cmd-b and and cmd-i are system wide key bindings that OS X doesn't
// handle for us, so the editor handles them.
- return event.modifiers & WebInputEvent::MetaKey
- && event.windowsKeyCode != VK_B
- && event.windowsKeyCode != VK_I;
+ int modifiers = event.modifiers & WebInputEvent::InputModifiers;
+ if (modifiers == WebInputEvent::MetaKey && event.windowsKeyCode == VK_B)
+ return false;
+ if (modifiers == WebInputEvent::MetaKey && event.windowsKeyCode == VK_I)
+ return false;
+
+ return event.modifiers & WebInputEvent::MetaKey;
}
WebKeyboardEvent WebInputEventFactory::keyboardEvent(NSEvent* event)
« no previous file with comments | « no previous file | Source/web/tests/WebInputEventFactoryTestMac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698