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

Unified Diff: Source/platform/PlatformWheelEvent.h

Issue 727593003: Implement MouseEvent buttons attribute. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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
Index: Source/platform/PlatformWheelEvent.h
diff --git a/Source/platform/PlatformWheelEvent.h b/Source/platform/PlatformWheelEvent.h
index 7eebb25f43bd2eff3ea4270297a2f42631aec15b..ce94e734b3c179fd9c89e111f31955316172b33b 100644
--- a/Source/platform/PlatformWheelEvent.h
+++ b/Source/platform/PlatformWheelEvent.h
@@ -104,6 +104,20 @@ public:
bool hasPreciseScrollingDeltas() const { return m_hasPreciseScrollingDeltas; }
void setHasPreciseScrollingDeltas(bool b) { m_hasPreciseScrollingDeltas = b; }
+
+ unsigned short buttons() const
+ {
+ unsigned short value = 0;
+
+ if (m_modifiers & LeftButtonDown)
+ value |= 1;
+ if (m_modifiers & RightButtonDown)
+ value |= 2;
+ if (m_modifiers & MiddleButtonDown)
+ value |= 4;
+
+ return value;
+ }
#if OS(MACOSX)
PlatformWheelEventPhase phase() const { return m_phase; }
PlatformWheelEventPhase momentumPhase() const { return m_momentumPhase; }

Powered by Google App Engine
This is Rietveld 408576698