Index: ui/base/events/event_utils.cc |
diff --git a/ui/base/events/event_utils.cc b/ui/base/events/event_utils.cc |
index ac09854bbfb9319dc46ec2a018b1444212677993..e530cff904dbd1cff0d4c15eed2fb582bc1ec7e0 100644 |
--- a/ui/base/events/event_utils.cc |
+++ b/ui/base/events/event_utils.cc |
@@ -25,4 +25,30 @@ base::TimeDelta EventTimeForNow() { |
base::TimeTicks::Now().ToInternalValue()); |
} |
+bool IsKeyEventType(EventType type) { |
+ return type == ET_KEY_PRESSED || |
+ type == ET_KEY_RELEASED || |
+ type == ET_TRANSLATED_KEY_PRESS || |
+ type == ET_TRANSLATED_KEY_RELEASE; |
+} |
+ |
+bool IsMouseEventType(EventType type) { |
+ return type == ET_MOUSE_PRESSED || |
+ type == ET_MOUSE_DRAGGED || |
+ type == ET_MOUSE_RELEASED || |
+ type == ET_MOUSE_MOVED || |
+ type == ET_MOUSE_ENTERED || |
+ type == ET_MOUSE_EXITED || |
+ type == ET_MOUSEWHEEL || |
+ type == ET_MOUSE_CAPTURE_CHANGED; |
+} |
+ |
+bool IsTouchEventType(EventType type) { |
+ return type == ET_TOUCH_RELEASED || |
+ type == ET_TOUCH_PRESSED || |
+ type == ET_TOUCH_MOVED || |
+ type == ET_TOUCH_STATIONARY || |
+ type == ET_TOUCH_CANCELLED; |
+} |
+ |
} // namespace ui |