OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // This file has no header guard because it is explicily intended | 5 // This file has no header guard because it is explicily intended |
6 // to be included more than once with different definitions of the | 6 // to be included more than once with different definitions of the |
7 // macros DOM_KEY_MAP and DOM_KEY_MAP_DECLARATION. | 7 // macros DOM_KEY_MAP and DOM_KEY_MAP_DECLARATION. |
8 | 8 |
9 // This is a table of DOM Level 3 .key values, used to generate identifiers | 9 // This is a table of DOM Level 3 .key values, used to generate identifiers |
10 // (enums) and string tables. These names are defined by: | 10 // (enums) and string tables. These names are defined by: |
11 // | 11 // |
12 // [0] DOM Level 3 KeyboardEvent key Values, | 12 // [0] DOM Level 3 KeyboardEvent key Values, |
13 // http://www.w3.org/TR/DOM-Level-3-Events-key/ | 13 // http://www.w3.org/TR/DOM-Level-3-Events-key/ |
14 // | 14 // |
15 // That reference should be consulted on the meaning and usage of these | 15 // That reference should be consulted on the meaning and usage of these |
16 // values; this file does not attempt to describe that. | 16 // values; this file does not attempt to describe that. |
17 // | 17 // |
18 // The names given in the table here directly match the DOM Level 3 value, | 18 // The names given in the table here directly match the DOM Level 3 value, |
19 // and for the most part the corresponding enum identifier is generated from | 19 // and for the most part the corresponding enum identifier is generated from |
20 // the name by converting W3C's CamelCaseStyle to Chromium's C_MACRO_STYLE. | 20 // the name by converting W3C's CamelCaseStyle to Chromium's C_MACRO_STYLE. |
21 | 21 |
22 DOM_KEY_MAP_DECLARATION { | 22 DOM_KEY_MAP_DECLARATION { |
23 | 23 |
24 // The first entry, whose enum value will be zero, is reserved to mean | 24 // To avoid ambiguities, a small number of .key values that do have |
25 // no value; there is no corresponding DOM string. (This is not the same | 25 // standard names are encoded identical to corresponding Unicode characters; |
26 // as the valid DOM .key value 'Unidentified'.) | 26 // for example, DomKey('\t') == DomKey::TAB. |
| 27 // |
| 28 // Key Enum Unicode code point |
| 29 DOM_KEY_UNI("Backspace", BACKSPACE, 0x0008), |
| 30 DOM_KEY_UNI("Tab", TAB, 0x0009), |
| 31 DOM_KEY_UNI("Enter", ENTER, 0x000D), |
| 32 DOM_KEY_UNI("Escape", ESCAPE, 0x001B), |
| 33 // The enum constant for 'Delete' (Forward Delete) is named DEL because |
| 34 // DELETE conflicts with an unscoped declaration in Windows' <windows.h>. |
| 35 DOM_KEY_UNI("Delete", DEL, 0x007F), |
27 | 36 |
28 // Key Enum | 37 DOM_KEY_MAP_BEGIN |
29 DOM_KEY_MAP(nullptr, NONE), // No value | |
30 | |
31 // A value of DomKey::CHARACTER indicates that the KeyboardEvent |key| | |
32 // string is determined by the Unicode character interpretation and is | |
33 // not one of the fixed string values. | |
34 DOM_KEY_MAP(nullptr, CHARACTER), | |
35 | 38 |
36 // ========================================================= | 39 // ========================================================= |
37 // Special Key Values | 40 // Special Key Values |
38 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-special | 41 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-special |
39 // ========================================================= | 42 // ========================================================= |
40 | 43 |
41 // Unable to identify another key value | 44 // Unable to identify another key value |
42 DOM_KEY_MAP("Unidentified", UNIDENTIFIED), | 45 DOM_KEY_MAP("Unidentified", UNIDENTIFIED), |
43 | 46 |
44 // ========================================================== | 47 // ========================================================== |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 // either directly or as synthetic modifier up/down events. | 80 // either directly or as synthetic modifier up/down events. |
78 // Key Enum | 81 // Key Enum |
79 DOM_KEY_MAP(".AltGraphLatch", ALT_GRAPH_LATCH), | 82 DOM_KEY_MAP(".AltGraphLatch", ALT_GRAPH_LATCH), |
80 | 83 |
81 // ============================================================ | 84 // ============================================================ |
82 // Whitespace Keys | 85 // Whitespace Keys |
83 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-whitespace | 86 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-whitespace |
84 // ============================================================ | 87 // ============================================================ |
85 | 88 |
86 // Key Enum | 89 // Key Enum |
87 DOM_KEY_MAP("Enter", ENTER), // Enter, Return | 90 // "Enter" is encoded in the Unicode space (at the end of this list). |
88 DOM_KEY_MAP("Separator", SEPARATOR), | 91 DOM_KEY_MAP("Separator", SEPARATOR), |
89 DOM_KEY_MAP("Tab", TAB), | 92 // "Tab" is encoded in the Unicode space. |
90 | 93 |
91 // ============================================================ | 94 // ============================================================ |
92 // Navigation Keys | 95 // Navigation Keys |
93 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-navigation | 96 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-navigation |
94 // ============================================================ | 97 // ============================================================ |
95 | 98 |
96 // Key Enum | 99 // Key Enum |
97 DOM_KEY_MAP("ArrowDown", ARROW_DOWN), | 100 DOM_KEY_MAP("ArrowDown", ARROW_DOWN), |
98 DOM_KEY_MAP("ArrowLeft", ARROW_LEFT), | 101 DOM_KEY_MAP("ArrowLeft", ARROW_LEFT), |
99 DOM_KEY_MAP("ArrowRight", ARROW_RIGHT), | 102 DOM_KEY_MAP("ArrowRight", ARROW_RIGHT), |
100 DOM_KEY_MAP("ArrowUp", ARROW_UP), | 103 DOM_KEY_MAP("ArrowUp", ARROW_UP), |
101 DOM_KEY_MAP("End", END), | 104 DOM_KEY_MAP("End", END), |
102 DOM_KEY_MAP("Home", HOME), | 105 DOM_KEY_MAP("Home", HOME), |
103 DOM_KEY_MAP("PageDown", PAGE_DOWN), | 106 DOM_KEY_MAP("PageDown", PAGE_DOWN), |
104 DOM_KEY_MAP("PageUp", PAGE_UP), | 107 DOM_KEY_MAP("PageUp", PAGE_UP), |
105 | 108 |
106 // ========================================================= | 109 // ========================================================= |
107 // Editing Keys | 110 // Editing Keys |
108 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-editing | 111 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-editing |
109 // ========================================================= | 112 // ========================================================= |
110 | 113 |
111 // Key Enum | 114 // Key Enum |
112 DOM_KEY_MAP("Backspace", BACKSPACE), | 115 // "Backspace" is encoded in the Unicode space. |
113 DOM_KEY_MAP("Clear", CLEAR), | 116 DOM_KEY_MAP("Clear", CLEAR), |
114 DOM_KEY_MAP("Copy", COPY), | 117 DOM_KEY_MAP("Copy", COPY), |
115 DOM_KEY_MAP("CrSel", CR_SEL), // Cursor Select | 118 DOM_KEY_MAP("CrSel", CR_SEL), // Cursor Select |
116 DOM_KEY_MAP("Cut", CUT), | 119 DOM_KEY_MAP("Cut", CUT), |
117 // Delete (Forward Delete) named DEL because DELETE conflicts with <windows.h> | 120 // "Delete" is encoded in the Unicode space. |
118 DOM_KEY_MAP("Delete", DEL), | |
119 DOM_KEY_MAP("EraseEof", ERASE_EOF), // Erase to End of Field | 121 DOM_KEY_MAP("EraseEof", ERASE_EOF), // Erase to End of Field |
120 DOM_KEY_MAP("ExSel", EX_SEL), // Extend Selection | 122 DOM_KEY_MAP("ExSel", EX_SEL), // Extend Selection |
121 DOM_KEY_MAP("Insert", INSERT), | 123 DOM_KEY_MAP("Insert", INSERT), |
122 DOM_KEY_MAP("Paste", PASTE), | 124 DOM_KEY_MAP("Paste", PASTE), |
123 DOM_KEY_MAP("Redo", REDO), | 125 DOM_KEY_MAP("Redo", REDO), |
124 DOM_KEY_MAP("Undo", UNDO), | 126 DOM_KEY_MAP("Undo", UNDO), |
125 | 127 |
126 // ==================================================== | 128 // ==================================================== |
127 // UI Keys | 129 // UI Keys |
128 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-ui | 130 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-ui |
129 // ==================================================== | 131 // ==================================================== |
130 | 132 |
131 // Key Enum | 133 // Key Enum |
132 DOM_KEY_MAP("Accept", ACCEPT), // Accept current IME conversion | 134 DOM_KEY_MAP("Accept", ACCEPT), // Accept current IME conversion |
133 DOM_KEY_MAP("Again", AGAIN), // Repeat an action | 135 DOM_KEY_MAP("Again", AGAIN), // Repeat an action |
134 DOM_KEY_MAP("Attn", ATTN), // Attention | 136 DOM_KEY_MAP("Attn", ATTN), // Attention |
135 DOM_KEY_MAP("Cancel", CANCEL), | 137 DOM_KEY_MAP("Cancel", CANCEL), |
136 DOM_KEY_MAP("ContextMenu", CONTEXT_MENU), | 138 DOM_KEY_MAP("ContextMenu", CONTEXT_MENU), |
137 DOM_KEY_MAP("Escape", ESCAPE), | 139 // "Escape" is encoded in the Unicode space. |
138 DOM_KEY_MAP("Execute", EXECUTE), | 140 DOM_KEY_MAP("Execute", EXECUTE), |
139 DOM_KEY_MAP("Find", FIND), | 141 DOM_KEY_MAP("Find", FIND), |
140 DOM_KEY_MAP("Help", HELP), | 142 DOM_KEY_MAP("Help", HELP), |
141 DOM_KEY_MAP("Pause", PAUSE), // Program state - not for media | 143 DOM_KEY_MAP("Pause", PAUSE), // Program state - not for media |
142 DOM_KEY_MAP("Play", PLAY), // Program state - not for media | 144 DOM_KEY_MAP("Play", PLAY), // Program state - not for media |
143 DOM_KEY_MAP("Props", PROPS), // Properties | 145 DOM_KEY_MAP("Props", PROPS), // Properties |
144 DOM_KEY_MAP("Select", SELECT), | 146 DOM_KEY_MAP("Select", SELECT), |
145 DOM_KEY_MAP("ZoomIn", ZOOM_IN), | 147 DOM_KEY_MAP("ZoomIn", ZOOM_IN), |
146 DOM_KEY_MAP("ZoomOut", ZOOM_OUT), | 148 DOM_KEY_MAP("ZoomOut", ZOOM_OUT), |
147 | 149 |
(...skipping 19 matching lines...) Expand all Loading... |
167 // IME and Composition Keys | 169 // IME and Composition Keys |
168 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-composition | 170 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-composition |
169 // ============================================================= | 171 // ============================================================= |
170 | 172 |
171 // Key Enum | 173 // Key Enum |
172 DOM_KEY_MAP("AllCandidates", ALL_CANDIDATES), | 174 DOM_KEY_MAP("AllCandidates", ALL_CANDIDATES), |
173 DOM_KEY_MAP("Alphanumeric", ALPHANUMERIC), | 175 DOM_KEY_MAP("Alphanumeric", ALPHANUMERIC), |
174 DOM_KEY_MAP("CodeInput", CODE_INPUT), | 176 DOM_KEY_MAP("CodeInput", CODE_INPUT), |
175 DOM_KEY_MAP("Compose", COMPOSE), | 177 DOM_KEY_MAP("Compose", COMPOSE), |
176 DOM_KEY_MAP("Convert", CONVERT), | 178 DOM_KEY_MAP("Convert", CONVERT), |
177 DOM_KEY_MAP("Dead", DEAD), | 179 // "Dead" is represented as a flag plus combining character. |
178 DOM_KEY_MAP("FinalMode", FINAL_MODE), | 180 DOM_KEY_MAP("FinalMode", FINAL_MODE), |
179 DOM_KEY_MAP("GroupFirst", GROUP_FIRST), | 181 DOM_KEY_MAP("GroupFirst", GROUP_FIRST), |
180 DOM_KEY_MAP("GroupLast", GROUP_LAST), | 182 DOM_KEY_MAP("GroupLast", GROUP_LAST), |
181 DOM_KEY_MAP("GroupNext", GROUP_NEXT), | 183 DOM_KEY_MAP("GroupNext", GROUP_NEXT), |
182 DOM_KEY_MAP("GroupPrevious", GROUP_PREVIOUS), | 184 DOM_KEY_MAP("GroupPrevious", GROUP_PREVIOUS), |
183 DOM_KEY_MAP("ModeChange", MODE_CHANGE), | 185 DOM_KEY_MAP("ModeChange", MODE_CHANGE), |
184 DOM_KEY_MAP("NextCandidate", NEXT_CANDIDATE), | 186 DOM_KEY_MAP("NextCandidate", NEXT_CANDIDATE), |
185 DOM_KEY_MAP("NonConvert", NON_CONVERT), | 187 DOM_KEY_MAP("NonConvert", NON_CONVERT), |
186 DOM_KEY_MAP("PreviousCandidate", PREVIOUS_CANDIDATE), | 188 DOM_KEY_MAP("PreviousCandidate", PREVIOUS_CANDIDATE), |
187 DOM_KEY_MAP("Process", PROCESS), | 189 DOM_KEY_MAP("Process", PROCESS), |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 DOM_KEY_MAP("STBInput", STB_INPUT), | 382 DOM_KEY_MAP("STBInput", STB_INPUT), |
381 DOM_KEY_MAP("STBPower", STB_POWER), | 383 DOM_KEY_MAP("STBPower", STB_POWER), |
382 DOM_KEY_MAP("Subtitle", SUBTITLE), | 384 DOM_KEY_MAP("Subtitle", SUBTITLE), |
383 DOM_KEY_MAP("Teletext", TELETEXT), | 385 DOM_KEY_MAP("Teletext", TELETEXT), |
384 DOM_KEY_MAP("TV", T_V), | 386 DOM_KEY_MAP("TV", T_V), |
385 DOM_KEY_MAP("TVInput", TV_INPUT), | 387 DOM_KEY_MAP("TVInput", TV_INPUT), |
386 DOM_KEY_MAP("TVPower", TV_POWER), | 388 DOM_KEY_MAP("TVPower", TV_POWER), |
387 DOM_KEY_MAP("VideoModeNext", VIDEO_MODE_NEXT), | 389 DOM_KEY_MAP("VideoModeNext", VIDEO_MODE_NEXT), |
388 DOM_KEY_MAP("Wink", WINK), | 390 DOM_KEY_MAP("Wink", WINK), |
389 DOM_KEY_MAP("ZoomToggle", ZOOM_TOGGLE), | 391 DOM_KEY_MAP("ZoomToggle", ZOOM_TOGGLE), |
| 392 |
| 393 DOM_KEY_MAP_END |
390 }; | 394 }; |
OLD | NEW |