1 // Copyright 2020 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef UI_EVENTS_TYPES_EVENT_TYPE_H_ 6 #define UI_EVENTS_TYPES_EVENT_TYPE_H_ 7 8 namespace ui { 9 10 // Event types. (prefixed because of a conflict with windows headers) 11 enum EventType { 12 ET_UNKNOWN = 0, 13 ET_MOUSE_PRESSED, 14 ET_MOUSE_DRAGGED, 15 ET_MOUSE_RELEASED, 16 ET_MOUSE_MOVED, 17 ET_MOUSE_ENTERED, 18 ET_MOUSE_EXITED, 19 ET_KEY_PRESSED, 20 ET_KEY_RELEASED, 21 ET_MOUSEWHEEL, 22 ET_MOUSE_CAPTURE_CHANGED, // Event has no location. 23 ET_TOUCH_RELEASED, 24 ET_TOUCH_PRESSED, 25 // NOTE: This corresponds to a drag and is always preceded by an 26 // ET_TOUCH_PRESSED. GestureRecognizers generally ignore ET_TOUCH_MOVED events 27 // without a corresponding ET_TOUCH_PRESSED. 28 ET_TOUCH_MOVED, 29 ET_TOUCH_CANCELLED, 30 ET_DROP_TARGET_EVENT, 31 32 // GestureEvent types 33 ET_GESTURE_SCROLL_BEGIN, 34 ET_GESTURE_TYPE_START = ET_GESTURE_SCROLL_BEGIN, 35 ET_GESTURE_SCROLL_END, 36 ET_GESTURE_SCROLL_UPDATE, 37 ET_GESTURE_TAP, 38 ET_GESTURE_TAP_DOWN, 39 ET_GESTURE_TAP_CANCEL, 40 ET_GESTURE_TAP_UNCONFIRMED, // User tapped, but the tap delay hasn't expired. 41 ET_GESTURE_DOUBLE_TAP, 42 ET_GESTURE_BEGIN, // The first event sent when each finger is pressed. 43 ET_GESTURE_END, // Sent for each released finger. 44 ET_GESTURE_TWO_FINGER_TAP, 45 ET_GESTURE_PINCH_BEGIN, 46 ET_GESTURE_PINCH_END, 47 ET_GESTURE_PINCH_UPDATE, 48 ET_GESTURE_LONG_PRESS, 49 ET_GESTURE_LONG_TAP, 50 // A SWIPE gesture can happen at the end of a touch sequence involving one or 51 // more fingers if the finger velocity was high enough when the first finger 52 // was released. 53 ET_GESTURE_SWIPE, 54 ET_GESTURE_SHOW_PRESS, 55 56 // Scroll support. 57 // TODO[davemoore] we need to unify these events w/ touch and gestures. 58 ET_SCROLL, 59 ET_SCROLL_FLING_START, 60 ET_SCROLL_FLING_CANCEL, 61 ET_GESTURE_TYPE_END = ET_SCROLL_FLING_CANCEL, 62 63 // Sent by the system to indicate any modal type operations, such as drag and 64 // drop or menus, should stop. 65 ET_CANCEL_MODE, 66 67 // Sent by the CrOS gesture library for interesting patterns that we want 68 // to track with the UMA system. 69 ET_UMA_DATA, 70 71 // Must always be last. User namespace starts above this value. 72 // See ui::RegisterCustomEventType(). 73 ET_LAST 74 }; 75 76 } // namespace ui 77 78 #endif // UI_EVENTS_TYPES_EVENT_TYPE_H_ 79