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

Side by Side Diff: ui/events/event_constants.h

Issue 1559163002: Clean up event flags a bit: (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comment Created 4 years, 11 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 unified diff | Download patch
« no previous file with comments | « ui/events/event.cc ('k') | ui/events/event_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_EVENTS_EVENT_CONSTANTS_H_ 5 #ifndef UI_EVENTS_EVENT_CONSTANTS_H_
6 #define UI_EVENTS_EVENT_CONSTANTS_H_ 6 #define UI_EVENTS_EVENT_CONSTANTS_H_
7 7
8 namespace ui { 8 namespace ui {
9 9
10 // Event types. (prefixed because of a conflict with windows headers) 10 // Event types. (prefixed because of a conflict with windows headers)
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 66
67 // Sent by the CrOS gesture library for interesting patterns that we want 67 // Sent by the CrOS gesture library for interesting patterns that we want
68 // to track with the UMA system. 68 // to track with the UMA system.
69 ET_UMA_DATA, 69 ET_UMA_DATA,
70 70
71 // Must always be last. User namespace starts above this value. 71 // Must always be last. User namespace starts above this value.
72 // See ui::RegisterCustomEventType(). 72 // See ui::RegisterCustomEventType().
73 ET_LAST 73 ET_LAST
74 }; 74 };
75 75
76 // Event flags currently supported 76 // Event flags currently supported. It is OK to add values to the middle of
77 // this list and/or reorder it, but make sure you also touch the various other
78 // enums/constants that want to stay in sync with this.
77 enum EventFlags { 79 enum EventFlags {
78 EF_NONE = 0, // Used to denote no flags explicitly 80 EF_NONE = 0, // Used to denote no flags explicitly
79 EF_CAPS_LOCK_DOWN = 1 << 0, 81
82 // Universally applicable status bits.
83 EF_IS_SYNTHESIZED = 1 << 0,
84
85 // Modifier key state.
80 EF_SHIFT_DOWN = 1 << 1, 86 EF_SHIFT_DOWN = 1 << 1,
81 EF_CONTROL_DOWN = 1 << 2, 87 EF_CONTROL_DOWN = 1 << 2,
82 EF_ALT_DOWN = 1 << 3, 88 EF_ALT_DOWN = 1 << 3,
83 EF_LEFT_MOUSE_BUTTON = 1 << 4, 89 EF_COMMAND_DOWN = 1 << 4, // GUI Key (e.g. Command on OS X
84 EF_MIDDLE_MOUSE_BUTTON = 1 << 5,
85 EF_RIGHT_MOUSE_BUTTON = 1 << 6,
86 EF_COMMAND_DOWN = 1 << 7, // GUI Key (e.g. Command on OS X
87 // keyboards, Search on Chromebook 90 // keyboards, Search on Chromebook
88 // keyboards, Windows on MS-oriented 91 // keyboards, Windows on MS-oriented
89 // keyboards) 92 // keyboards)
90 EF_EXTENDED = 1 << 8, // Windows extended key (see WM_KEYDOWN 93 EF_ALTGR_DOWN = 1 << 5,
91 // doc) 94 EF_MOD3_DOWN = 1 << 6,
92 EF_IS_SYNTHESIZED = 1 << 9, 95
93 EF_ALTGR_DOWN = 1 << 10, 96 // Other keyboard state.
94 EF_MOD3_DOWN = 1 << 11, 97 EF_NUM_LOCK_ON = 1 << 7,
95 EF_BACK_MOUSE_BUTTON = 1 << 12, 98 EF_CAPS_LOCK_ON = 1 << 8,
96 EF_FORWARD_MOUSE_BUTTON = 1 << 13, 99 EF_SCROLL_LOCK_ON = 1 << 9,
97 EF_NUM_LOCK_DOWN = 1 << 14, 100
98 EF_SCROLL_LOCK_DOWN = 1 << 15, 101 // Mouse buttons.
102 EF_LEFT_MOUSE_BUTTON = 1 << 10,
103 EF_MIDDLE_MOUSE_BUTTON = 1 << 11,
104 EF_RIGHT_MOUSE_BUTTON = 1 << 12,
105 EF_BACK_MOUSE_BUTTON = 1 << 13,
106 EF_FORWARD_MOUSE_BUTTON = 1 << 14,
99 }; 107 };
100 108
101 // Flags specific to key events 109 // Flags specific to key events
102 enum KeyEventFlags { 110 enum KeyEventFlags {
103 EF_IME_FABRICATED_KEY = 1 << 16, // Key event fabricated by the underlying 111 EF_IME_FABRICATED_KEY = 1 << 15, // Key event fabricated by the underlying
104 // IME without a user action. 112 // IME without a user action.
105 // (Linux X11 only) 113 // (Linux X11 only)
106 EF_IS_REPEAT = 1 << 17, 114 EF_IS_REPEAT = 1 << 16,
107 EF_FINAL = 1 << 18, // Do not remap; the event was created with 115 EF_FINAL = 1 << 17, // Do not remap; the event was created with
108 // the desired final values. 116 // the desired final values.
117 EF_IS_EXTENDED_KEY = 1 << 18, // Windows extended key (see WM_KEYDOWN doc)
109 }; 118 };
110 119
111 // Flags specific to mouse events 120 // Flags specific to mouse events
112 enum MouseEventFlags { 121 enum MouseEventFlags {
113 EF_IS_DOUBLE_CLICK = 1 << 16, 122 EF_IS_DOUBLE_CLICK = 1 << 15,
114 EF_IS_TRIPLE_CLICK = 1 << 17, 123 EF_IS_TRIPLE_CLICK = 1 << 16,
115 EF_IS_NON_CLIENT = 1 << 18, 124 EF_IS_NON_CLIENT = 1 << 17,
116 EF_FROM_TOUCH = 1 << 19, // Indicates this mouse event is generated 125 EF_FROM_TOUCH = 1 << 18, // Indicates this mouse event is generated
117 // from an unconsumed touch/gesture event. 126 // from an unconsumed touch/gesture event.
118 EF_TOUCH_ACCESSIBILITY = 1 << 20, // Indicates this event was generated from 127 EF_TOUCH_ACCESSIBILITY = 1 << 19, // Indicates this event was generated from
119 // touch accessibility mode. 128 // touch accessibility mode.
120 }; 129 };
121 130
122 // Result of dispatching an event. 131 // Result of dispatching an event.
123 enum EventResult { 132 enum EventResult {
124 ER_UNHANDLED = 0, // The event hasn't been handled. The event can be 133 ER_UNHANDLED = 0, // The event hasn't been handled. The event can be
125 // propagated to other handlers. 134 // propagated to other handlers.
126 ER_HANDLED = 1 << 0, // The event has already been handled, but it can 135 ER_HANDLED = 1 << 0, // The event has already been handled, but it can
127 // still be propagated to other handlers. 136 // still be propagated to other handlers.
128 ER_CONSUMED = 1 << 1, // The event has been handled, and it should not be 137 ER_CONSUMED = 1 << 1, // The event has been handled, and it should not be
(...skipping 23 matching lines...) Expand all
152 enum class EventPointerType : int { 161 enum class EventPointerType : int {
153 POINTER_TYPE_UNKNOWN = 0, 162 POINTER_TYPE_UNKNOWN = 0,
154 POINTER_TYPE_MOUSE, 163 POINTER_TYPE_MOUSE,
155 POINTER_TYPE_PEN, 164 POINTER_TYPE_PEN,
156 POINTER_TYPE_TOUCH, 165 POINTER_TYPE_TOUCH,
157 }; 166 };
158 167
159 } // namespace ui 168 } // namespace ui
160 169
161 #endif // UI_EVENTS_EVENT_CONSTANTS_H_ 170 #endif // UI_EVENTS_EVENT_CONSTANTS_H_
OLDNEW
« no previous file with comments | « ui/events/event.cc ('k') | ui/events/event_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698