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

Unified Diff: ui/events/gesture_detection/motion_event.h

Issue 348813002: Extend MotionEvent to have tool type and button state (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 6 years, 6 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 | « ui/events/gesture_detection/mock_motion_event.cc ('k') | ui/events/gestures/motion_event_aura.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/gesture_detection/motion_event.h
diff --git a/ui/events/gesture_detection/motion_event.h b/ui/events/gesture_detection/motion_event.h
index 3cf4235b78a37815d1b800fd86aa50b4960d694f..b69a38f295abaf30ad2220f50a93ea8392066dcf 100644
--- a/ui/events/gesture_detection/motion_event.h
+++ b/ui/events/gesture_detection/motion_event.h
@@ -24,6 +24,21 @@ class GESTURE_DETECTION_EXPORT MotionEvent {
ACTION_POINTER_UP,
};
+ enum ToolType {
+ TOOL_TYPE_UNKNOWN,
+ TOOL_TYPE_FINGER,
+ TOOL_TYPE_STYLUS,
+ TOOL_TYPE_MOUSE,
+ };
+
+ enum ButtonType {
+ BUTTON_PRIMARY = 1 << 0,
+ BUTTON_SECONDARY = 1 << 1,
+ BUTTON_TERTIARY = 1 << 2,
+ BUTTON_BACK = 1 << 3,
+ BUTTON_FORWARD = 1 << 4,
+ };
+
// The implementer promises that |GetPointerId()| will never exceed this.
enum { MAX_POINTER_ID = 31 };
@@ -53,6 +68,8 @@ class GESTURE_DETECTION_EXPORT MotionEvent {
size_t historical_index) const = 0;
virtual float GetHistoricalY(size_t pointer_index,
size_t historical_index) const = 0;
+ virtual ToolType GetToolType(size_t pointer_index) const = 0;
+ virtual int GetButtonState() const = 0;
virtual scoped_ptr<MotionEvent> Clone() const = 0;
virtual scoped_ptr<MotionEvent> Cancel() const = 0;
« no previous file with comments | « ui/events/gesture_detection/mock_motion_event.cc ('k') | ui/events/gestures/motion_event_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698