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; |
} |