summaryrefslogtreecommitdiffstats
path: root/src/net/hoopajoo/android/SoftKeys/K.java
blob: b8538c53b41c95c88a780c3cb672cba411b21f40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
/*
 *
 *  Copyright (c) 2010 Steve Slaven
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program. If not, see <http://www.gnu.org/licenses/>.
 *
*/
package net.hoopajoo.android.SoftKeys;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

// Key constants and resolver maps
// Auto-generated from keycodes.txt
public class K {

    public static String KEY_SOFT_RIGHT = "soft_right"; 
    public static String KEY_HOME = "home"; 
    public static String KEY_BACK = "back"; 
    public static String KEY_CALL = "call"; 
    public static String KEY_ENDCALL = "endcall"; 
    public static String KEY_0 = "0"; 
    public static String KEY_1 = "1"; 
    public static String KEY_2 = "2"; 
    public static String KEY_3 = "3"; 
    public static String KEY_4 = "4"; 
    public static String KEY_5 = "5"; 
    public static String KEY_6 = "6"; 
    public static String KEY_7 = "7"; 
    public static String KEY_8 = "8"; 
    public static String KEY_9 = "9"; 
    public static String KEY_STAR = "star"; 
    public static String KEY_POUND = "pound"; 
    public static String KEY_DPAD_UP = "dpad_up"; 
    public static String KEY_DPAD_DOWN = "dpad_down"; 
    public static String KEY_DPAD_LEFT = "dpad_left"; 
    public static String KEY_DPAD_RIGHT = "dpad_right"; 
    public static String KEY_DPAD_CENTER = "dpad_center"; 
    public static String KEY_VOLUME_UP = "volume_up"; 
    public static String KEY_VOLUME_DOWN = "volume_down"; 
    public static String KEY_POWER = "power"; 
    public static String KEY_CAMERA = "camera"; 
    public static String KEY_CLEAR = "clear"; 
    public static String KEY_A = "a"; 
    public static String KEY_B = "b"; 
    public static String KEY_C = "c"; 
    public static String KEY_D = "d"; 
    public static String KEY_E = "e"; 
    public static String KEY_F = "f"; 
    public static String KEY_G = "g"; 
    public static String KEY_H = "h"; 
    public static String KEY_I = "i"; 
    public static String KEY_J = "j"; 
    public static String KEY_K = "k"; 
    public static String KEY_L = "l"; 
    public static String KEY_M = "m"; 
    public static String KEY_N = "n"; 
    public static String KEY_O = "o"; 
    public static String KEY_P = "p"; 
    public static String KEY_Q = "q"; 
    public static String KEY_R = "r"; 
    public static String KEY_S = "s"; 
    public static String KEY_T = "t"; 
    public static String KEY_U = "u"; 
    public static String KEY_V = "v"; 
    public static String KEY_W = "w"; 
    public static String KEY_X = "x"; 
    public static String KEY_Y = "y"; 
    public static String KEY_Z = "z"; 
    public static String KEY_COMMA = "comma"; 
    public static String KEY_PERIOD = "period"; 
    public static String KEY_ALT_LEFT = "alt_left"; 
    public static String KEY_ALT_RIGHT = "alt_right"; 
    public static String KEY_SHIFT_LEFT = "shift_left"; 
    public static String KEY_SHIFT_RIGHT = "shift_right"; 
    public static String KEY_TAB = "tab"; 
    public static String KEY_SPACE = "space"; 
    public static String KEY_SYM = "sym"; 
    public static String KEY_EXPLORER = "explorer"; 
    public static String KEY_ENVELOPE = "envelope"; 
    public static String KEY_ENTER = "enter"; 
    public static String KEY_DEL = "del"; 
    public static String KEY_GRAVE = "grave"; 
    public static String KEY_MINUS = "minus"; 
    public static String KEY_EQUALS = "equals"; 
    public static String KEY_LEFT_BRACKET = "left_bracket"; 
    public static String KEY_RIGHT_BRACKET = "right_bracket"; 
    public static String KEY_BACKSLASH = "backslash"; 
    public static String KEY_SEMICOLON = "semicolon"; 
    public static String KEY_APOSTROPHE = "apostrophe"; 
    public static String KEY_SLASH = "slash"; 
    public static String KEY_AT = "at"; 
    public static String KEY_NUM = "num"; 
    public static String KEY_HEADSETHOOK = "headsethook"; 
    public static String KEY_FOCUS = "focus"; 
    public static String KEY_PLUS = "plus"; 
    public static String KEY_MENU = "menu"; 
    public static String KEY_NOTIFICATION = "notification"; 
    public static String KEY_SEARCH = "search"; 
    public static String KEY_TAG_LAST_KEYCODE = "tag_last_keycode"; 

    public static int KEYID_SOFT_RIGHT = 2;
    public static int KEYID_HOME = 3;
    public static int KEYID_BACK = 4;
    public static int KEYID_CALL = 5;
    public static int KEYID_ENDCALL = 6;
    public static int KEYID_0 = 7;
    public static int KEYID_1 = 8;
    public static int KEYID_2 = 9;
    public static int KEYID_3 = 10;
    public static int KEYID_4 = 11;
    public static int KEYID_5 = 12;
    public static int KEYID_6 = 13;
    public static int KEYID_7 = 14;
    public static int KEYID_8 = 15;
    public static int KEYID_9 = 16;
    public static int KEYID_STAR = 17;
    public static int KEYID_POUND = 18;
    public static int KEYID_DPAD_UP = 19;
    public static int KEYID_DPAD_DOWN = 20;
    public static int KEYID_DPAD_LEFT = 21;
    public static int KEYID_DPAD_RIGHT = 22;
    public static int KEYID_DPAD_CENTER = 23;
    public static int KEYID_VOLUME_UP = 24;
    public static int KEYID_VOLUME_DOWN = 25;
    public static int KEYID_POWER = 26;
    public static int KEYID_CAMERA = 27;
    public static int KEYID_CLEAR = 28;
    public static int KEYID_A = 29;
    public static int KEYID_B = 30;
    public static int KEYID_C = 31;
    public static int KEYID_D = 32;
    public static int KEYID_E = 33;
    public static int KEYID_F = 34;
    public static int KEYID_G = 35;
    public static int KEYID_H = 36;
    public static int KEYID_I = 37;
    public static int KEYID_J = 38;
    public static int KEYID_K = 39;
    public static int KEYID_L = 40;
    public static int KEYID_M = 41;
    public static int KEYID_N = 42;
    public static int KEYID_O = 43;
    public static int KEYID_P = 44;
    public static int KEYID_Q = 45;
    public static int KEYID_R = 46;
    public static int KEYID_S = 47;
    public static int KEYID_T = 48;
    public static int KEYID_U = 49;
    public static int KEYID_V = 50;
    public static int KEYID_W = 51;
    public static int KEYID_X = 52;
    public static int KEYID_Y = 53;
    public static int KEYID_Z = 54;
    public static int KEYID_COMMA = 55;
    public static int KEYID_PERIOD = 56;
    public static int KEYID_ALT_LEFT = 57;
    public static int KEYID_ALT_RIGHT = 58;
    public static int KEYID_SHIFT_LEFT = 59;
    public static int KEYID_SHIFT_RIGHT = 60;
    public static int KEYID_TAB = 61;
    public static int KEYID_SPACE = 62;
    public static int KEYID_SYM = 63;
    public static int KEYID_EXPLORER = 64;
    public static int KEYID_ENVELOPE = 65;
    public static int KEYID_ENTER = 66;
    public static int KEYID_DEL = 67;
    public static int KEYID_GRAVE = 68;
    public static int KEYID_MINUS = 69;
    public static int KEYID_EQUALS = 70;
    public static int KEYID_LEFT_BRACKET = 71;
    public static int KEYID_RIGHT_BRACKET = 72;
    public static int KEYID_BACKSLASH = 73;
    public static int KEYID_SEMICOLON = 74;
    public static int KEYID_APOSTROPHE = 75;
    public static int KEYID_SLASH = 76;
    public static int KEYID_AT = 77;
    public static int KEYID_NUM = 78;
    public static int KEYID_HEADSETHOOK = 79;
    public static int KEYID_FOCUS = 80;
    public static int KEYID_PLUS = 81;
    public static int KEYID_MENU = 82;
    public static int KEYID_NOTIFICATION = 83;
    public static int KEYID_SEARCH = 84;
    public static int KEYID_TAG_LAST_KEYCODE = 85;

    private static final Map<String,Integer> mKeymap;
    private static final Map<Integer,String> mNamemap;
    static {
        Map<String,Integer> t = new HashMap<String,Integer>();
        Map<Integer,String> s = new HashMap<Integer,String>();

        s.put( KEYID_SOFT_RIGHT, KEY_SOFT_RIGHT );
        t.put( KEY_SOFT_RIGHT, KEYID_SOFT_RIGHT );
        s.put( KEYID_HOME, KEY_HOME );
        t.put( KEY_HOME, KEYID_HOME );
        s.put( KEYID_BACK, KEY_BACK );
        t.put( KEY_BACK, KEYID_BACK );
        s.put( KEYID_CALL, KEY_CALL );
        t.put( KEY_CALL, KEYID_CALL );
        s.put( KEYID_ENDCALL, KEY_ENDCALL );
        t.put( KEY_ENDCALL, KEYID_ENDCALL );
        s.put( KEYID_0, KEY_0 );
        t.put( KEY_0, KEYID_0 );
        s.put( KEYID_1, KEY_1 );
        t.put( KEY_1, KEYID_1 );
        s.put( KEYID_2, KEY_2 );
        t.put( KEY_2, KEYID_2 );
        s.put( KEYID_3, KEY_3 );
        t.put( KEY_3, KEYID_3 );
        s.put( KEYID_4, KEY_4 );
        t.put( KEY_4, KEYID_4 );
        s.put( KEYID_5, KEY_5 );
        t.put( KEY_5, KEYID_5 );
        s.put( KEYID_6, KEY_6 );
        t.put( KEY_6, KEYID_6 );
        s.put( KEYID_7, KEY_7 );
        t.put( KEY_7, KEYID_7 );
        s.put( KEYID_8, KEY_8 );
        t.put( KEY_8, KEYID_8 );
        s.put( KEYID_9, KEY_9 );
        t.put( KEY_9, KEYID_9 );
        s.put( KEYID_STAR, KEY_STAR );
        t.put( KEY_STAR, KEYID_STAR );
        s.put( KEYID_POUND, KEY_POUND );
        t.put( KEY_POUND, KEYID_POUND );
        s.put( KEYID_DPAD_UP, KEY_DPAD_UP );
        t.put( KEY_DPAD_UP, KEYID_DPAD_UP );
        s.put( KEYID_DPAD_DOWN, KEY_DPAD_DOWN );
        t.put( KEY_DPAD_DOWN, KEYID_DPAD_DOWN );
        s.put( KEYID_DPAD_LEFT, KEY_DPAD_LEFT );
        t.put( KEY_DPAD_LEFT, KEYID_DPAD_LEFT );
        s.put( KEYID_DPAD_RIGHT, KEY_DPAD_RIGHT );
        t.put( KEY_DPAD_RIGHT, KEYID_DPAD_RIGHT );
        s.put( KEYID_DPAD_CENTER, KEY_DPAD_CENTER );
        t.put( KEY_DPAD_CENTER, KEYID_DPAD_CENTER );
        s.put( KEYID_VOLUME_UP, KEY_VOLUME_UP );
        t.put( KEY_VOLUME_UP, KEYID_VOLUME_UP );
        s.put( KEYID_VOLUME_DOWN, KEY_VOLUME_DOWN );
        t.put( KEY_VOLUME_DOWN, KEYID_VOLUME_DOWN );
        s.put( KEYID_POWER, KEY_POWER );
        t.put( KEY_POWER, KEYID_POWER );
        s.put( KEYID_CAMERA, KEY_CAMERA );
        t.put( KEY_CAMERA, KEYID_CAMERA );
        s.put( KEYID_CLEAR, KEY_CLEAR );
        t.put( KEY_CLEAR, KEYID_CLEAR );
        s.put( KEYID_A, KEY_A );
        t.put( KEY_A, KEYID_A );
        s.put( KEYID_B, KEY_B );
        t.put( KEY_B, KEYID_B );
        s.put( KEYID_C, KEY_C );
        t.put( KEY_C, KEYID_C );
        s.put( KEYID_D, KEY_D );
        t.put( KEY_D, KEYID_D );
        s.put( KEYID_E, KEY_E );
        t.put( KEY_E, KEYID_E );
        s.put( KEYID_F, KEY_F );
        t.put( KEY_F, KEYID_F );
        s.put( KEYID_G, KEY_G );
        t.put( KEY_G, KEYID_G );
        s.put( KEYID_H, KEY_H );
        t.put( KEY_H, KEYID_H );
        s.put( KEYID_I, KEY_I );
        t.put( KEY_I, KEYID_I );
        s.put( KEYID_J, KEY_J );
        t.put( KEY_J, KEYID_J );
        s.put( KEYID_K, KEY_K );
        t.put( KEY_K, KEYID_K );
        s.put( KEYID_L, KEY_L );
        t.put( KEY_L, KEYID_L );
        s.put( KEYID_M, KEY_M );
        t.put( KEY_M, KEYID_M );
        s.put( KEYID_N, KEY_N );
        t.put( KEY_N, KEYID_N );
        s.put( KEYID_O, KEY_O );
        t.put( KEY_O, KEYID_O );
        s.put( KEYID_P, KEY_P );
        t.put( KEY_P, KEYID_P );
        s.put( KEYID_Q, KEY_Q );
        t.put( KEY_Q, KEYID_Q );
        s.put( KEYID_R, KEY_R );
        t.put( KEY_R, KEYID_R );
        s.put( KEYID_S, KEY_S );
        t.put( KEY_S, KEYID_S );
        s.put( KEYID_T, KEY_T );
        t.put( KEY_T, KEYID_T );
        s.put( KEYID_U, KEY_U );
        t.put( KEY_U, KEYID_U );
        s.put( KEYID_V, KEY_V );
        t.put( KEY_V, KEYID_V );
        s.put( KEYID_W, KEY_W );
        t.put( KEY_W, KEYID_W );
        s.put( KEYID_X, KEY_X );
        t.put( KEY_X, KEYID_X );
        s.put( KEYID_Y, KEY_Y );
        t.put( KEY_Y, KEYID_Y );
        s.put( KEYID_Z, KEY_Z );
        t.put( KEY_Z, KEYID_Z );
        s.put( KEYID_COMMA, KEY_COMMA );
        t.put( KEY_COMMA, KEYID_COMMA );
        s.put( KEYID_PERIOD, KEY_PERIOD );
        t.put( KEY_PERIOD, KEYID_PERIOD );
        s.put( KEYID_ALT_LEFT, KEY_ALT_LEFT );
        t.put( KEY_ALT_LEFT, KEYID_ALT_LEFT );
        s.put( KEYID_ALT_RIGHT, KEY_ALT_RIGHT );
        t.put( KEY_ALT_RIGHT, KEYID_ALT_RIGHT );
        s.put( KEYID_SHIFT_LEFT, KEY_SHIFT_LEFT );
        t.put( KEY_SHIFT_LEFT, KEYID_SHIFT_LEFT );
        s.put( KEYID_SHIFT_RIGHT, KEY_SHIFT_RIGHT );
        t.put( KEY_SHIFT_RIGHT, KEYID_SHIFT_RIGHT );
        s.put( KEYID_TAB, KEY_TAB );
        t.put( KEY_TAB, KEYID_TAB );
        s.put( KEYID_SPACE, KEY_SPACE );
        t.put( KEY_SPACE, KEYID_SPACE );
        s.put( KEYID_SYM, KEY_SYM );
        t.put( KEY_SYM, KEYID_SYM );
        s.put( KEYID_EXPLORER, KEY_EXPLORER );
        t.put( KEY_EXPLORER, KEYID_EXPLORER );
        s.put( KEYID_ENVELOPE, KEY_ENVELOPE );
        t.put( KEY_ENVELOPE, KEYID_ENVELOPE );
        s.put( KEYID_ENTER, KEY_ENTER );
        t.put( KEY_ENTER, KEYID_ENTER );
        s.put( KEYID_DEL, KEY_DEL );
        t.put( KEY_DEL, KEYID_DEL );
        s.put( KEYID_GRAVE, KEY_GRAVE );
        t.put( KEY_GRAVE, KEYID_GRAVE );
        s.put( KEYID_MINUS, KEY_MINUS );
        t.put( KEY_MINUS, KEYID_MINUS );
        s.put( KEYID_EQUALS, KEY_EQUALS );
        t.put( KEY_EQUALS, KEYID_EQUALS );
        s.put( KEYID_LEFT_BRACKET, KEY_LEFT_BRACKET );
        t.put( KEY_LEFT_BRACKET, KEYID_LEFT_BRACKET );
        s.put( KEYID_RIGHT_BRACKET, KEY_RIGHT_BRACKET );
        t.put( KEY_RIGHT_BRACKET, KEYID_RIGHT_BRACKET );
        s.put( KEYID_BACKSLASH, KEY_BACKSLASH );
        t.put( KEY_BACKSLASH, KEYID_BACKSLASH );
        s.put( KEYID_SEMICOLON, KEY_SEMICOLON );
        t.put( KEY_SEMICOLON, KEYID_SEMICOLON );
        s.put( KEYID_APOSTROPHE, KEY_APOSTROPHE );
        t.put( KEY_APOSTROPHE, KEYID_APOSTROPHE );
        s.put( KEYID_SLASH, KEY_SLASH );
        t.put( KEY_SLASH, KEYID_SLASH );
        s.put( KEYID_AT, KEY_AT );
        t.put( KEY_AT, KEYID_AT );
        s.put( KEYID_NUM, KEY_NUM );
        t.put( KEY_NUM, KEYID_NUM );
        s.put( KEYID_HEADSETHOOK, KEY_HEADSETHOOK );
        t.put( KEY_HEADSETHOOK, KEYID_HEADSETHOOK );
        s.put( KEYID_FOCUS, KEY_FOCUS );
        t.put( KEY_FOCUS, KEYID_FOCUS );
        s.put( KEYID_PLUS, KEY_PLUS );
        t.put( KEY_PLUS, KEYID_PLUS );
        s.put( KEYID_MENU, KEY_MENU );
        t.put( KEY_MENU, KEYID_MENU );
        s.put( KEYID_NOTIFICATION, KEY_NOTIFICATION );
        t.put( KEY_NOTIFICATION, KEYID_NOTIFICATION );
        s.put( KEYID_SEARCH, KEY_SEARCH );
        t.put( KEY_SEARCH, KEYID_SEARCH );
        s.put( KEYID_TAG_LAST_KEYCODE, KEY_TAG_LAST_KEYCODE );
        t.put( KEY_TAG_LAST_KEYCODE, KEYID_TAG_LAST_KEYCODE );

        mKeymap = Collections.unmodifiableMap( t );
        mNamemap = Collections.unmodifiableMap( s );
    }

    public static int keyNameToId( String n ) {
        if( ! mKeymap.containsKey( n ) ) {
            return 0;
        }
        return mKeymap.get( n );
    }

    public static String keyIdToName( int id ) {
        if( ! mNamemap.containsKey( id ) ) {
            return null;
        }
        return mNamemap.get( id );
    }
}