| Index: Source/platform/PlatformMouseEvent.h
|
| diff --git a/Source/platform/PlatformMouseEvent.h b/Source/platform/PlatformMouseEvent.h
|
| index 488bd0c211c910e5137fe452603608f3484de634..070ab9839f6bc3030ef4bda0677b863cfb8ec647 100644
|
| --- a/Source/platform/PlatformMouseEvent.h
|
| +++ b/Source/platform/PlatformMouseEvent.h
|
| @@ -61,6 +61,7 @@ public:
|
| , m_synthesized(RealOrIndistinguishable)
|
| , m_modifierFlags(0)
|
| {
|
| + addModifierFromButton(button);
|
| }
|
|
|
| PlatformMouseEvent(const IntPoint& position, const IntPoint& globalPosition, MouseButton button, PlatformEvent::Type type, int clickCount, Modifiers modifiers, SyntheticEventType synthesized, double timestamp)
|
| @@ -72,6 +73,7 @@ public:
|
| , m_synthesized(synthesized)
|
| , m_modifierFlags(0)
|
| {
|
| + addModifierFromButton(button);
|
| }
|
|
|
| PlatformMouseEvent(const IntPoint& position, const IntPoint& globalPosition, MouseButton button, PlatformEvent::Type type, int clickCount, bool shiftKey, bool ctrlKey, bool altKey, bool metaKey, SyntheticEventType synthesized, double timestamp)
|
| @@ -83,6 +85,7 @@ public:
|
| , m_synthesized(synthesized)
|
| , m_modifierFlags(0)
|
| {
|
| + addModifierFromButton(button);
|
| }
|
|
|
| const IntPoint& position() const { return m_position; }
|
| @@ -95,6 +98,18 @@ public:
|
| bool fromTouch() const { return m_synthesized == FromTouch; }
|
| SyntheticEventType syntheticEventType() const { return m_synthesized; }
|
|
|
| +private:
|
| + void addModifierFromButton(MouseButton button)
|
| + {
|
| + if (!fromTouch() || button == NoButton)
|
| + return;
|
| +
|
| + const unsigned map[] = {
|
| + LeftButtonDown, MiddleButtonDown, RightButtonDown
|
| + };
|
| + m_modifiers |= map[button];
|
| + }
|
| +
|
| protected:
|
| IntPoint m_position;
|
| IntPoint m_globalPosition;
|
|
|