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

Unified Diff: Source/web/WebInputEventFactoryMac.mm

Issue 788173002: Should set the modifiers for web mouse event on Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fixed Created 6 years 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 | no next file » | 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 e71b93ce071dfecab22ef8c652ff42fa0ca90142..fcdde0dbd1a81fe48c39c588ff00b30a6fdaa62b 100644
--- a/Source/web/WebInputEventFactoryMac.mm
+++ b/Source/web/WebInputEventFactoryMac.mm
@@ -722,7 +722,12 @@ static inline int modifiersFromEvent(NSEvent* event) {
modifiers |= WebInputEvent::MetaKey;
if ([event modifierFlags] & NSAlphaShiftKeyMask)
modifiers |= WebInputEvent::CapsLockOn;
- // TODO(port): Set mouse button states
+ if ([NSEvent pressedMouseButtons] & 1 << 0)
haraken 2014/12/11 16:24:13 Don't we want to have a constant variable for 1 <<
zino 2014/12/11 17:01:28 Done. IMHO, it is better to use constant values h
+ modifiers |= WebInputEvent::LeftButtonDown;
+ if ([NSEvent pressedMouseButtons] & 1 << 1)
+ modifiers |= WebInputEvent::RightButtonDown;
+ if ([NSEvent pressedMouseButtons] & 1 << 2)
+ modifiers |= WebInputEvent::MiddleButtonDown;
return modifiers;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698