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

Side by Side Diff: sdk/lib/html/src/KeyCode.dart

Issue 11362065: Add KeyCode enumeration in Dart. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 /**
Jennifer Messerly 2012/11/02 22:46:17 Might be worth a comment (in the source code, not
6 * Defines the keycode values for keys that are returned by
7 * KeyboardEvent.keyCode.
8 *
9 * Important note: There is substantial divergence in how different browsers
10 * handle keycodes and their variants in different locales/keyboard layouts. We
11 * provide these constants to help make code processing keys more readable.
12 */
13 abstract class KeyCode {
14 static final int WIN_KEY_FF_LINUX = 0;
15 static final int MAC_ENTER = 3;
16 static final int BACKSPACE = 8;
17 static final int TAB = 9;
18 static final int NUM_CENTER = 12;
19 static final int NUMLOCK = 12;
20 static final int ENTER = 13;
21 static final int SHIFT = 16;
22 static final int CTRL = 17;
23 static final int ALT = 18;
24 static final int PAUSE = 19;
25 static final int CAPS_LOCK = 20;
26 static final int ESC = 27;
27 static final int SPACE = 32;
28 static final int PAGE_UP = 33;
29 static final int PAGE_DOWN = 34;
30 static final int END = 35;
31 static final int HOME = 36;
32 static final int LEFT = 37;
33 static final int UP = 38;
34 static final int RIGHT = 39;
35 static final int DOWN = 40;
36 static final int NUM_NORTH_EAST = 33;
37 static final int NUM_SOUTH_EAST = 34;
38 static final int NUM_SOUTH_WEST = 35;
39 static final int NUM_NORTH_WEST = 36;
40 static final int NUM_WEST = 37;
41 static final int NUM_NORTH = 38;
42 static final int NUM_EAST = 39;
43 static final int NUM_SOUTH = 40;
44 static final int PRINT_SCREEN = 44;
45 static final int INSERT = 45;
46 static final int NUM_INSERT = 45;
47 static final int DELETE = 46;
48 static final int NUM_DELETE = 46;
49 static final int ZERO = 48;
50 static final int ONE = 49;
51 static final int TWO = 50;
52 static final int THREE = 51;
53 static final int FOUR = 52;
54 static final int FIVE = 53;
55 static final int SIX = 54;
56 static final int SEVEN = 55;
57 static final int EIGHT = 56;
58 static final int NINE = 57;
59 static final int FF_SEMICOLON = 59;
60 static final int FF_EQUALS = 61;
61 /**
62 * CAUTION: The question mark is for US-keyboard layouts. It varies
63 * for other locales and keyboard layouts.
64 */
65 static final int QUESTION_MARK = 63;
66 static final int A = 65;
67 static final int B = 66;
68 static final int C = 67;
69 static final int D = 68;
70 static final int E = 69;
71 static final int F = 70;
72 static final int G = 71;
73 static final int H = 72;
74 static final int I = 73;
75 static final int J = 74;
76 static final int K = 75;
77 static final int L = 76;
78 static final int M = 77;
79 static final int N = 78;
80 static final int O = 79;
81 static final int P = 80;
82 static final int Q = 81;
83 static final int R = 82;
84 static final int S = 83;
85 static final int T = 84;
86 static final int U = 85;
87 static final int V = 86;
88 static final int W = 87;
89 static final int X = 88;
90 static final int Y = 89;
91 static final int Z = 90;
92 static final int META = 91;
93 static final int WIN_KEY_LEFT = 91;
94 static final int WIN_KEY_RIGHT = 92;
95 static final int CONTEXT_MENU = 93;
96 static final int NUM_ZERO = 96;
97 static final int NUM_ONE = 97;
98 static final int NUM_TWO = 98;
99 static final int NUM_THREE = 99;
100 static final int NUM_FOUR = 100;
101 static final int NUM_FIVE = 101;
102 static final int NUM_SIX = 102;
103 static final int NUM_SEVEN = 103;
104 static final int NUM_EIGHT = 104;
105 static final int NUM_NINE = 105;
106 static final int NUM_MULTIPLY = 106;
107 static final int NUM_PLUS = 107;
108 static final int NUM_MINUS = 109;
109 static final int NUM_PERIOD = 110;
110 static final int NUM_DIVISION = 111;
111 static final int F1 = 112;
112 static final int F2 = 113;
113 static final int F3 = 114;
114 static final int F4 = 115;
115 static final int F5 = 116;
116 static final int F6 = 117;
117 static final int F7 = 118;
118 static final int F8 = 119;
119 static final int F9 = 120;
120 static final int F10 = 121;
121 static final int F11 = 122;
122 static final int F12 = 123;
123 static final int NUMLOCK = 144;
124 static final int SCROLL_LOCK = 145;
125
126 // OS-specific media keys like volume controls and browser controls.
127 static final int FIRST_MEDIA_KEY = 166;
128 static final int LAST_MEDIA_KEY = 183;
129
130 /**
131 * CAUTION: This constant requires localization for other locales and keyboard
132 * layouts.
133 */
134 static final int SEMICOLON = 186;
135 /**
136 * CAUTION: This constant requires localization for other locales and keyboard
137 * layouts.
138 */
139 static final int DASH = 189;
140 /**
141 * CAUTION: This constant requires localization for other locales and keyboard
142 * layouts.
143 */
144 static final int EQUALS = 187;
145 /**
146 * CAUTION: This constant requires localization for other locales and keyboard
147 * layouts.
148 */
149 static final int COMMA = 188;
150 /**
151 * CAUTION: This constant requires localization for other locales and keyboard
152 * layouts.
153 */
154 static final int PERIOD = 190;
155 /**
156 * CAUTION: This constant requires localization for other locales and keyboard
157 * layouts.
158 */
159 static final int SLASH = 191;
160 /**
161 * CAUTION: This constant requires localization for other locales and keyboard
162 * layouts.
163 */
164 static final int APOSTROPHE = 192;
165 /**
166 * CAUTION: This constant requires localization for other locales and keyboard
167 * layouts.
168 */
169 static final int TILDE = 192;
170 /**
171 * CAUTION: This constant requires localization for other locales and keyboard
172 * layouts.
173 */
174 static final int SINGLE_QUOTE = 222;
175 /**
176 * CAUTION: This constant requires localization for other locales and keyboard
177 * layouts.
178 */
179 static final int OPEN_SQUARE_BRACKET = 219;
180 /**
181 * CAUTION: This constant requires localization for other locales and keyboard
182 * layouts.
183 */
184 static final int BACKSLASH = 220;
185 /**
186 * CAUTION: This constant requires localization for other locales and keyboard
187 * layouts.
188 */
189 static final int CLOSE_SQUARE_BRACKET = 221;
190 static final int WIN_KEY = 224;
191 static final int MAC_FF_META = 224;
192 static final int WIN_IME = 229;
193 }
OLDNEW
« no previous file with comments | « sdk/lib/html/scripts/fremontcutbuilder.py ('k') | sdk/lib/html/templates/html/dart2js/html_dart2js.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698