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 |
kpschoedel
2015/08/07 20:42:12
In the previous code, there were some special case
| |
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 24 matching lines...) Expand all Loading... | |
69 // used by such layouts as Neo (German) and Multix (French-Canadian). | 72 // used by such layouts as Neo (German) and Multix (French-Canadian). |
70 // Key Enum | 73 // Key Enum |
71 DOM_KEY_MAP("ShiftLevel5", SHIFT_LEVEL5), | 74 DOM_KEY_MAP("ShiftLevel5", SHIFT_LEVEL5), |
72 | 75 |
73 // ============================================================ | 76 // ============================================================ |
74 // Whitespace Keys | 77 // Whitespace Keys |
75 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-whitespace | 78 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-whitespace |
76 // ============================================================ | 79 // ============================================================ |
77 | 80 |
78 // Key Enum | 81 // Key Enum |
79 DOM_KEY_MAP("Enter", ENTER), // Enter, Return | 82 // "Enter" is encoded in the Unicode space (at the end of this list). |
80 DOM_KEY_MAP("Separator", SEPARATOR), | 83 DOM_KEY_MAP("Separator", SEPARATOR), |
81 DOM_KEY_MAP("Tab", TAB), | 84 // "Tab" is encoded in the Unicode space. |
82 | 85 |
83 // ============================================================ | 86 // ============================================================ |
84 // Navigation Keys | 87 // Navigation Keys |
85 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-navigation | 88 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-navigation |
86 // ============================================================ | 89 // ============================================================ |
87 | 90 |
88 // Key Enum | 91 // Key Enum |
89 DOM_KEY_MAP("ArrowDown", ARROW_DOWN), | 92 DOM_KEY_MAP("ArrowDown", ARROW_DOWN), |
90 DOM_KEY_MAP("ArrowLeft", ARROW_LEFT), | 93 DOM_KEY_MAP("ArrowLeft", ARROW_LEFT), |
91 DOM_KEY_MAP("ArrowRight", ARROW_RIGHT), | 94 DOM_KEY_MAP("ArrowRight", ARROW_RIGHT), |
92 DOM_KEY_MAP("ArrowUp", ARROW_UP), | 95 DOM_KEY_MAP("ArrowUp", ARROW_UP), |
93 DOM_KEY_MAP("End", END), | 96 DOM_KEY_MAP("End", END), |
94 DOM_KEY_MAP("Home", HOME), | 97 DOM_KEY_MAP("Home", HOME), |
95 DOM_KEY_MAP("PageDown", PAGE_DOWN), | 98 DOM_KEY_MAP("PageDown", PAGE_DOWN), |
96 DOM_KEY_MAP("PageUp", PAGE_UP), | 99 DOM_KEY_MAP("PageUp", PAGE_UP), |
97 | 100 |
98 // ========================================================= | 101 // ========================================================= |
99 // Editing Keys | 102 // Editing Keys |
100 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-editing | 103 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-editing |
101 // ========================================================= | 104 // ========================================================= |
102 | 105 |
103 // Key Enum | 106 // Key Enum |
104 DOM_KEY_MAP("Backspace", BACKSPACE), | 107 // "Backspace" is encoded in the Unicode space. |
105 DOM_KEY_MAP("Clear", CLEAR), | 108 DOM_KEY_MAP("Clear", CLEAR), |
106 DOM_KEY_MAP("Copy", COPY), | 109 DOM_KEY_MAP("Copy", COPY), |
107 DOM_KEY_MAP("CrSel", CR_SEL), // Cursor Select | 110 DOM_KEY_MAP("CrSel", CR_SEL), // Cursor Select |
108 DOM_KEY_MAP("Cut", CUT), | 111 DOM_KEY_MAP("Cut", CUT), |
109 // Delete (Forward Delete) named DEL because DELETE conflicts with <windows.h> | 112 // "Delete" is encoded in the Unicode space. |
110 DOM_KEY_MAP("Delete", DEL), | |
111 DOM_KEY_MAP("EraseEof", ERASE_EOF), // Erase to End of Field | 113 DOM_KEY_MAP("EraseEof", ERASE_EOF), // Erase to End of Field |
112 DOM_KEY_MAP("ExSel", EX_SEL), // Extend Selection | 114 DOM_KEY_MAP("ExSel", EX_SEL), // Extend Selection |
113 DOM_KEY_MAP("Insert", INSERT), | 115 DOM_KEY_MAP("Insert", INSERT), |
114 DOM_KEY_MAP("Paste", PASTE), | 116 DOM_KEY_MAP("Paste", PASTE), |
115 DOM_KEY_MAP("Redo", REDO), | 117 DOM_KEY_MAP("Redo", REDO), |
116 DOM_KEY_MAP("Undo", UNDO), | 118 DOM_KEY_MAP("Undo", UNDO), |
117 | 119 |
118 // ==================================================== | 120 // ==================================================== |
119 // UI Keys | 121 // UI Keys |
120 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-ui | 122 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-ui |
121 // ==================================================== | 123 // ==================================================== |
122 | 124 |
123 // Key Enum | 125 // Key Enum |
124 DOM_KEY_MAP("Accept", ACCEPT), // Accept current IME conversion | 126 DOM_KEY_MAP("Accept", ACCEPT), // Accept current IME conversion |
125 DOM_KEY_MAP("Again", AGAIN), // Repeat an action | 127 DOM_KEY_MAP("Again", AGAIN), // Repeat an action |
126 DOM_KEY_MAP("Attn", ATTN), // Attention | 128 DOM_KEY_MAP("Attn", ATTN), // Attention |
127 DOM_KEY_MAP("Cancel", CANCEL), | 129 DOM_KEY_MAP("Cancel", CANCEL), |
128 DOM_KEY_MAP("ContextMenu", CONTEXT_MENU), | 130 DOM_KEY_MAP("ContextMenu", CONTEXT_MENU), |
129 DOM_KEY_MAP("Escape", ESCAPE), | 131 // "Escape" is encoded in the Unicode space. |
130 DOM_KEY_MAP("Execute", EXECUTE), | 132 DOM_KEY_MAP("Execute", EXECUTE), |
131 DOM_KEY_MAP("Find", FIND), | 133 DOM_KEY_MAP("Find", FIND), |
132 DOM_KEY_MAP("Help", HELP), | 134 DOM_KEY_MAP("Help", HELP), |
133 DOM_KEY_MAP("Pause", PAUSE), // Program state - not for media | 135 DOM_KEY_MAP("Pause", PAUSE), // Program state - not for media |
134 DOM_KEY_MAP("Play", PLAY), // Program state - not for media | 136 DOM_KEY_MAP("Play", PLAY), // Program state - not for media |
135 DOM_KEY_MAP("Props", PROPS), // Properties | 137 DOM_KEY_MAP("Props", PROPS), // Properties |
136 DOM_KEY_MAP("Select", SELECT), | 138 DOM_KEY_MAP("Select", SELECT), |
137 DOM_KEY_MAP("ZoomIn", ZOOM_IN), | 139 DOM_KEY_MAP("ZoomIn", ZOOM_IN), |
138 DOM_KEY_MAP("ZoomOut", ZOOM_OUT), | 140 DOM_KEY_MAP("ZoomOut", ZOOM_OUT), |
139 | 141 |
(...skipping 19 matching lines...) Expand all Loading... | |
159 // IME and Composition Keys | 161 // IME and Composition Keys |
160 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-composition | 162 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-composition |
161 // ============================================================= | 163 // ============================================================= |
162 | 164 |
163 // Key Enum | 165 // Key Enum |
164 DOM_KEY_MAP("AllCandidates", ALL_CANDIDATES), | 166 DOM_KEY_MAP("AllCandidates", ALL_CANDIDATES), |
165 DOM_KEY_MAP("Alphanumeric", ALPHANUMERIC), | 167 DOM_KEY_MAP("Alphanumeric", ALPHANUMERIC), |
166 DOM_KEY_MAP("CodeInput", CODE_INPUT), | 168 DOM_KEY_MAP("CodeInput", CODE_INPUT), |
167 DOM_KEY_MAP("Compose", COMPOSE), | 169 DOM_KEY_MAP("Compose", COMPOSE), |
168 DOM_KEY_MAP("Convert", CONVERT), | 170 DOM_KEY_MAP("Convert", CONVERT), |
169 DOM_KEY_MAP("Dead", DEAD), | 171 // "Dead" is represented as a flag plus combining character. |
170 DOM_KEY_MAP("FinalMode", FINAL_MODE), | 172 DOM_KEY_MAP("FinalMode", FINAL_MODE), |
171 DOM_KEY_MAP("GroupFirst", GROUP_FIRST), | 173 DOM_KEY_MAP("GroupFirst", GROUP_FIRST), |
172 DOM_KEY_MAP("GroupLast", GROUP_LAST), | 174 DOM_KEY_MAP("GroupLast", GROUP_LAST), |
173 DOM_KEY_MAP("GroupNext", GROUP_NEXT), | 175 DOM_KEY_MAP("GroupNext", GROUP_NEXT), |
174 DOM_KEY_MAP("GroupPrevious", GROUP_PREVIOUS), | 176 DOM_KEY_MAP("GroupPrevious", GROUP_PREVIOUS), |
175 DOM_KEY_MAP("ModeChange", MODE_CHANGE), | 177 DOM_KEY_MAP("ModeChange", MODE_CHANGE), |
176 DOM_KEY_MAP("NextCandidate", NEXT_CANDIDATE), | 178 DOM_KEY_MAP("NextCandidate", NEXT_CANDIDATE), |
177 DOM_KEY_MAP("NonConvert", NON_CONVERT), | 179 DOM_KEY_MAP("NonConvert", NON_CONVERT), |
178 DOM_KEY_MAP("PreviousCandidate", PREVIOUS_CANDIDATE), | 180 DOM_KEY_MAP("PreviousCandidate", PREVIOUS_CANDIDATE), |
179 DOM_KEY_MAP("Process", PROCESS), | 181 DOM_KEY_MAP("Process", PROCESS), |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
372 DOM_KEY_MAP("STBInput", STB_INPUT), | 374 DOM_KEY_MAP("STBInput", STB_INPUT), |
373 DOM_KEY_MAP("STBPower", STB_POWER), | 375 DOM_KEY_MAP("STBPower", STB_POWER), |
374 DOM_KEY_MAP("Subtitle", SUBTITLE), | 376 DOM_KEY_MAP("Subtitle", SUBTITLE), |
375 DOM_KEY_MAP("Teletext", TELETEXT), | 377 DOM_KEY_MAP("Teletext", TELETEXT), |
376 DOM_KEY_MAP("TV", T_V), | 378 DOM_KEY_MAP("TV", T_V), |
377 DOM_KEY_MAP("TVInput", TV_INPUT), | 379 DOM_KEY_MAP("TVInput", TV_INPUT), |
378 DOM_KEY_MAP("TVPower", TV_POWER), | 380 DOM_KEY_MAP("TVPower", TV_POWER), |
379 DOM_KEY_MAP("VideoModeNext", VIDEO_MODE_NEXT), | 381 DOM_KEY_MAP("VideoModeNext", VIDEO_MODE_NEXT), |
380 DOM_KEY_MAP("Wink", WINK), | 382 DOM_KEY_MAP("Wink", WINK), |
381 DOM_KEY_MAP("ZoomToggle", ZOOM_TOGGLE), | 383 DOM_KEY_MAP("ZoomToggle", ZOOM_TOGGLE), |
384 | |
385 DOM_KEY_MAP_END | |
382 }; | 386 }; |
OLD | NEW |