1 // Copyright (c) 2012 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.
5 #ifndef UI_BASE_EVENTS_EVENT_CONSTANTS_H_
6 #define UI_BASE_EVENTS_EVENT_CONSTANTS_H_
10 // Event types. (prefixed because of a conflict with windows headers)
22 ET_MOUSE_CAPTURE_CHANGED
, // Event has no location.
29 ET_TRANSLATED_KEY_PRESS
,
30 ET_TRANSLATED_KEY_RELEASE
,
33 ET_GESTURE_SCROLL_BEGIN
,
34 ET_GESTURE_SCROLL_END
,
35 ET_GESTURE_SCROLL_UPDATE
,
38 ET_GESTURE_TAP_CANCEL
,
39 ET_GESTURE_BEGIN
, // Sent before any other gesture types.
40 ET_GESTURE_END
, // Sent after any other gestures.
41 ET_GESTURE_DOUBLE_TAP
,
42 ET_GESTURE_TWO_FINGER_TAP
,
43 ET_GESTURE_PINCH_BEGIN
,
45 ET_GESTURE_PINCH_UPDATE
,
46 ET_GESTURE_LONG_PRESS
,
48 // A SWIPE gesture can happen at the end of a TAP_UP gesture if the
49 // finger(s) were moving quickly before they are released.
50 ET_GESTURE_MULTIFINGER_SWIPE
,
53 // TODO[davemoore] we need to unify these events w/ touch and gestures.
55 ET_SCROLL_FLING_START
,
56 ET_SCROLL_FLING_CANCEL
,
58 // Must always be last. User namespace starts above this value.
59 // See ui::RegisterCustomEventType().
63 // Event flags currently supported
65 EF_NONE
= 0, // Used to denote no flags explicitly
66 EF_CAPS_LOCK_DOWN
= 1 << 0,
67 EF_SHIFT_DOWN
= 1 << 1,
68 EF_CONTROL_DOWN
= 1 << 2,
70 EF_LEFT_MOUSE_BUTTON
= 1 << 4,
71 EF_MIDDLE_MOUSE_BUTTON
= 1 << 5,
72 EF_RIGHT_MOUSE_BUTTON
= 1 << 6,
73 EF_COMMAND_DOWN
= 1 << 7, // Only useful on OSX
74 EF_EXTENDED
= 1 << 8, // Windows extended key (see WM_KEYDOWN doc)
77 // Flags specific to mouse events
78 enum MouseEventFlags
{
79 EF_IS_DOUBLE_CLICK
= 1 << 16,
80 EF_IS_TRIPLE_CLICK
= 1 << 17,
81 EF_IS_NON_CLIENT
= 1 << 18,
82 EF_IS_SYNTHESIZED
= 1 << 19, // Only for Aura. See ui/aura/root_window.h
83 EF_FROM_TOUCH
= 1 << 20, // Indicates this mouse event is generated
84 // from an unconsumed touch/gesture event.
87 // Result of dispatching an event.
89 ER_UNHANDLED
= 0, // The event hasn't been handled. The event can be
90 // propagated to other handlers.
91 ER_HANDLED
= 1 << 0, // The event has already been handled, but it can
92 // still be propagated to other handlers.
93 ER_CONSUMED
= 1 << 1, // The event has been handled, and it should not be
94 // propagated to other handlers.
97 // Phase of the event dispatch.
108 #endif // UI_BASE_EVENTS_EVENT_CONSTANTS_H_