• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16export const KeyCode = {
17    KEYCODE_FN: 0,
18    KEYCODE_UNKNOWN: -1,
19    KEYCODE_HOME: 1,
20    KEYCODE_BACK: 2,
21    KEYCODE_MEDIA_PLAY_PAUSE: 10,
22    KEYCODE_MEDIA_STOP: 11,
23    KEYCODE_MEDIA_NEXT: 12,
24    KEYCODE_MEDIA_PREVIOUS: 13,
25    KEYCODE_MEDIA_REWIND: 14,
26    KEYCODE_MEDIA_FAST_FORWARD: 15,
27    KEYCODE_VOLUME_UP: 16,
28    KEYCODE_VOLUME_DOWN: 17,
29    KEYCODE_POWER: 18,
30    KEYCODE_CAMERA: 19,
31    KEYCODE_VOLUME_MUTE: 22,
32    KEYCODE_MUTE: 23,
33    KEYCODE_BRIGHTNESS_UP: 40,
34    KEYCODE_BRIGHTNESS_DOWN: 41,
35    KEYCODE_0: 2000,
36    KEYCODE_1: 2001,
37    KEYCODE_2: 2002,
38    KEYCODE_3: 2003,
39    KEYCODE_4: 2004,
40    KEYCODE_5: 2005,
41    KEYCODE_6: 2006,
42    KEYCODE_7: 2007,
43    KEYCODE_8: 2008,
44    KEYCODE_9: 2009,
45    KEYCODE_STAR: 2010,
46    KEYCODE_POUND: 2011,
47    KEYCODE_DPAD_UP: 2012,
48    KEYCODE_DPAD_DOWN: 2013,
49    KEYCODE_DPAD_LEFT: 2014,
50    KEYCODE_DPAD_RIGHT: 2015,
51    KEYCODE_DPAD_CENTER: 2016,
52    KEYCODE_A: 2017,
53    KEYCODE_B: 2018,
54    KEYCODE_C: 2019,
55    KEYCODE_D: 2020,
56    KEYCODE_E: 2021,
57    KEYCODE_F: 2022,
58    KEYCODE_G: 2023,
59    KEYCODE_H: 2024,
60    KEYCODE_I: 2025,
61    KEYCODE_J: 2026,
62    KEYCODE_K: 2027,
63    KEYCODE_L: 2028,
64    KEYCODE_M: 2029,
65    KEYCODE_N: 2030,
66    KEYCODE_O: 2031,
67    KEYCODE_P: 2032,
68    KEYCODE_Q: 2033,
69    KEYCODE_R: 2034,
70    KEYCODE_S: 2035,
71    KEYCODE_T: 2036,
72    KEYCODE_U: 2037,
73    KEYCODE_V: 2038,
74    KEYCODE_W: 2039,
75    KEYCODE_X: 2040,
76    KEYCODE_Y: 2041,
77    KEYCODE_Z: 2042,
78    KEYCODE_COMMA: 2043,
79    KEYCODE_PERIOD: 2044,
80    KEYCODE_ALT_LEFT: 2045,
81    KEYCODE_ALT_RIGHT: 2046,
82    KEYCODE_SHIFT_LEFT: 2047,
83    KEYCODE_SHIFT_RIGHT: 2048,
84    KEYCODE_TAB: 2049,
85    KEYCODE_SPACE: 2050,
86    KEYCODE_SYM: 2051,
87    KEYCODE_EXPLORER: 2052,
88    KEYCODE_ENVELOPE: 2053,
89    KEYCODE_ENTER: 2054,
90    KEYCODE_DEL: 2055,
91    KEYCODE_GRAVE: 2056,
92    KEYCODE_MINUS: 2057,
93    KEYCODE_EQUALS: 2058,
94    KEYCODE_LEFT_BRACKET: 2059,
95    KEYCODE_RIGHT_BRACKET: 2060,
96    KEYCODE_BACKSLASH: 2061,
97    KEYCODE_SEMICOLON: 2062,
98    KEYCODE_APOSTROPHE: 2063,
99    KEYCODE_SLASH: 2064,
100    KEYCODE_AT: 2065,
101    KEYCODE_PLUS: 2066,
102    KEYCODE_MENU: 2067,
103    KEYCODE_PAGE_UP: 2068,
104    KEYCODE_PAGE_DOWN: 2069,
105    KEYCODE_ESCAPE: 2070,
106    KEYCODE_FORWARD_DEL: 2071,
107    KEYCODE_CTRL_LEFT: 2072,
108    KEYCODE_CTRL_RIGHT: 2073,
109    KEYCODE_CAPS_LOCK: 2074,
110    KEYCODE_SCROLL_LOCK: 2075,
111    KEYCODE_META_LEFT: 2076,
112    KEYCODE_META_RIGHT: 2077,
113    KEYCODE_FUNCTION: 2078,
114    KEYCODE_SYSRQ: 2079,
115    KEYCODE_BREAK: 2080,
116    KEYCODE_MOVE_HOME: 2081,
117    KEYCODE_MOVE_END: 2082,
118    KEYCODE_INSERT: 2083,
119    KEYCODE_FORWARD: 2084,
120    KEYCODE_MEDIA_PLAY: 2085,
121    KEYCODE_MEDIA_PAUSE: 2086,
122    KEYCODE_MEDIA_CLOSE: 2087,
123    KEYCODE_MEDIA_EJECT: 2088,
124    KEYCODE_MEDIA_RECORD: 2089,
125    KEYCODE_F1: 2090,
126    KEYCODE_F2: 2091,
127    KEYCODE_F3: 2092,
128    KEYCODE_F4: 2093,
129    KEYCODE_F5: 2094,
130    KEYCODE_F6: 2095,
131    KEYCODE_F7: 2096,
132    KEYCODE_F8: 2097,
133    KEYCODE_F9: 2098,
134    KEYCODE_F10: 2099,
135    KEYCODE_F11: 2100,
136    KEYCODE_F12: 2101,
137    KEYCODE_NUM_LOCK: 2102,
138    KEYCODE_NUMPAD_0: 2103,
139    KEYCODE_NUMPAD_1: 2104,
140    KEYCODE_NUMPAD_2: 2105,
141    KEYCODE_NUMPAD_3: 2106,
142    KEYCODE_NUMPAD_4: 2107,
143    KEYCODE_NUMPAD_5: 2108,
144    KEYCODE_NUMPAD_6: 2109,
145    KEYCODE_NUMPAD_7: 2110,
146    KEYCODE_NUMPAD_8: 2111,
147    KEYCODE_NUMPAD_9: 2112,
148    KEYCODE_NUMPAD_DIVIDE: 2113,
149    KEYCODE_NUMPAD_MULTIPLY: 2114,
150    KEYCODE_NUMPAD_SUBTRACT: 2115,
151    KEYCODE_NUMPAD_ADD: 2116,
152    KEYCODE_NUMPAD_DOT: 2117,
153    KEYCODE_NUMPAD_COMMA: 2118,
154    KEYCODE_NUMPAD_ENTER: 2119,
155    KEYCODE_NUMPAD_EQUALS: 2120,
156    KEYCODE_NUMPAD_LEFT_PAREN: 2121,
157    KEYCODE_NUMPAD_RIGHT_PAREN: 2122,
158    KEYCODE_VIRTUAL_MULTITASK: 2210,
159    KEYCODE_SLEEP: 2600,
160    KEYCODE_ZENKAKU_HANKAKU: 2601,
161    KEYCODE_102ND: 2602,
162    KEYCODE_RO: 2603,
163    KEYCODE_KATAKANA: 2604,
164    KEYCODE_HIRAGANA: 2605,
165    KEYCODE_HENKAN: 2606,
166    KEYCODE_KATAKANA_HIRAGANA: 2607,
167    KEYCODE_MUHENKAN: 2608,
168    KEYCODE_LINEFEED: 2609,
169    KEYCODE_MACRO: 2610,
170    KEYCODE_NUMPAD_PLUSMINUS: 2611,
171    KEYCODE_SCALE: 2612,
172    KEYCODE_HANGUEL: 2613,
173    KEYCODE_HANJA: 2614,
174    KEYCODE_YEN: 2615,
175    KEYCODE_STOP: 2616,
176    KEYCODE_AGAIN: 2617,
177    KEYCODE_PROPS: 2618,
178    KEYCODE_UNDO: 2619,
179    KEYCODE_COPY: 2620,
180    KEYCODE_OPEN: 2621,
181    KEYCODE_PASTE: 2622,
182    KEYCODE_FIND: 2623,
183    KEYCODE_CUT: 2624,
184    KEYCODE_HELP: 2625,
185    KEYCODE_CALC: 2626,
186    KEYCODE_FILE: 2627,
187    KEYCODE_BOOKMARKS: 2628,
188    KEYCODE_NEXT: 2629,
189    KEYCODE_PLAYPAUSE: 2630,
190    KEYCODE_PREVIOUS: 2631,
191    KEYCODE_STOPCD: 2632,
192    KEYCODE_CONFIG: 2634,
193    KEYCODE_REFRESH: 2635,
194    KEYCODE_EXIT: 2636,
195    KEYCODE_EDIT: 2637,
196    KEYCODE_SCROLLUP: 2638,
197    KEYCODE_SCROLLDOWN: 2639,
198    KEYCODE_NEW: 2640,
199    KEYCODE_REDO: 2641,
200    KEYCODE_CLOSE: 2642,
201    KEYCODE_PLAY: 2643,
202    KEYCODE_BASSBOOST: 2644,
203    KEYCODE_PRINT: 2645,
204    KEYCODE_CHAT: 2646,
205    KEYCODE_FINANCE: 2647,
206    KEYCODE_CANCEL: 2648,
207    KEYCODE_KBDILLUM_TOGGLE: 2649,
208    KEYCODE_KBDILLUM_DOWN: 2650,
209    KEYCODE_KBDILLUM_UP: 2651,
210    KEYCODE_SEND: 2652,
211    KEYCODE_REPLY: 2653,
212    KEYCODE_FORWARDMAIL: 2654,
213    KEYCODE_SAVE: 2655,
214    KEYCODE_DOCUMENTS: 2656,
215    KEYCODE_VIDEO_NEXT: 2657,
216    KEYCODE_VIDEO_PREV: 2658,
217    KEYCODE_BRIGHTNESS_CYCLE: 2659,
218    KEYCODE_BRIGHTNESS_ZERO: 2660,
219    KEYCODE_DISPLAY_OFF: 2661,
220    KEYCODE_BTN_MISC: 2662,
221    KEYCODE_GOTO: 2663,
222    KEYCODE_INFO: 2664,
223    KEYCODE_PROGRAM: 2665,
224    KEYCODE_PVR: 2666,
225    KEYCODE_SUBTITLE: 2667,
226    KEYCODE_FULL_SCREEN: 2668,
227    KEYCODE_KEYBOARD: 2669,
228    KEYCODE_ASPECT_RATIO: 2670,
229    KEYCODE_PC: 2671,
230    KEYCODE_TV: 2672,
231    KEYCODE_TV2: 2673,
232    KEYCODE_VCR: 2674,
233    KEYCODE_VCR2: 2675,
234    KEYCODE_SAT: 2676,
235    KEYCODE_CD: 2677,
236    KEYCODE_TAPE: 2678,
237    KEYCODE_TUNER: 2679,
238    KEYCODE_PLAYER: 2680,
239    KEYCODE_DVD: 2681,
240    KEYCODE_AUDIO: 2682,
241    KEYCODE_VIDEO: 2683,
242    KEYCODE_MEMO: 2684,
243    KEYCODE_CALENDAR: 2685,
244    KEYCODE_RED: 2686,
245    KEYCODE_GREEN: 2687,
246    KEYCODE_YELLOW: 2688,
247    KEYCODE_BLUE: 2689,
248    KEYCODE_CHANNELUP: 2690,
249    KEYCODE_CHANNELDOWN: 2691,
250    KEYCODE_LAST: 2692,
251    KEYCODE_RESTART: 2693,
252    KEYCODE_SLOW: 2694,
253    KEYCODE_SHUFFLE: 2695,
254    KEYCODE_VIDEOPHONE: 2696,
255    KEYCODE_GAMES: 2697,
256    KEYCODE_ZOOMIN: 2698,
257    KEYCODE_ZOOMOUT: 2699,
258    KEYCODE_ZOOMRESET: 2700,
259    KEYCODE_WORDPROCESSOR: 2701,
260    KEYCODE_EDITOR: 2702,
261    KEYCODE_SPREADSHEET: 2703,
262    KEYCODE_GRAPHICSEDITOR: 2704,
263    KEYCODE_PRESENTATION: 2705,
264    KEYCODE_DATABASE: 2706,
265    KEYCODE_NEWS: 2707,
266    KEYCODE_VOICEMAIL: 2708,
267    KEYCODE_ADDRESSBOOK: 2709,
268    KEYCODE_MESSENGER: 2710,
269    KEYCODE_BRIGHTNESS_TOGGLE: 2711,
270    KEYCODE_SPELLCHECK: 2712,
271    KEYCODE_COFFEE: 2713,
272    KEYCODE_MEDIA_REPEAT: 2714,
273    KEYCODE_IMAGES: 2715,
274    KEYCODE_BUTTONCONFIG: 2716,
275    KEYCODE_TASKMANAGER: 2717,
276    KEYCODE_JOURNAL: 2718,
277    KEYCODE_CONTROLPANEL: 2719,
278    KEYCODE_APPSELECT: 2720,
279    KEYCODE_SCREENSAVER: 2721,
280    KEYCODE_ASSISTANT: 2722,
281    KEYCODE_KBD_LAYOUT_NEXT: 2723,
282    KEYCODE_BRIGHTNESS_MIN: 2724,
283    KEYCODE_BRIGHTNESS_MAX: 2725,
284    KEYCODE_KBDINPUTASSIST_PREV: 2726,
285    KEYCODE_KBDINPUTASSIST_NEXT: 2727,
286    KEYCODE_KBDINPUTASSIST_PREVGROUP: 2728,
287    KEYCODE_KBDINPUTASSIST_NEXTGROUP: 2729,
288    KEYCODE_KBDINPUTASSIST_ACCEPT: 2730,
289    KEYCODE_KBDINPUTASSIST_CANCEL: 2731,
290    KEYCODE_FRONT: 2800,
291    KEYCODE_SETUP: 2801,
292    KEYCODE_WAKEUP: 2802,
293    KEYCODE_SENDFILE: 2803,
294    KEYCODE_DELETEFILE: 2804,
295    KEYCODE_XFER: 2805,
296    KEYCODE_PROG1: 2806,
297    KEYCODE_PROG2: 2807,
298    KEYCODE_MSDOS: 2808,
299    KEYCODE_SCREENLOCK: 2809,
300    KEYCODE_DIRECTION_ROTATE_DISPLAY: 2810,
301    KEYCODE_CYCLEWINDOWS: 2811,
302    KEYCODE_COMPUTER: 2812,
303    KEYCODE_EJECTCLOSECD: 2813,
304    KEYCODE_ISO: 2814,
305    KEYCODE_MOVE: 2815,
306    KEYCODE_F13: 2816,
307    KEYCODE_F14: 2817,
308    KEYCODE_F15: 2818,
309    KEYCODE_F16: 2819,
310    KEYCODE_F17: 2820,
311    KEYCODE_F18: 2821,
312    KEYCODE_F19: 2822,
313    KEYCODE_F20: 2823,
314    KEYCODE_F21: 2824,
315    KEYCODE_F22: 2825,
316    KEYCODE_F23: 2826,
317    KEYCODE_F24: 2827,
318    KEYCODE_PROG3: 2828,
319    KEYCODE_PROG4: 2829,
320    KEYCODE_DASHBOARD: 2830,
321    KEYCODE_SUSPEND: 2831,
322    KEYCODE_HP: 2832,
323    KEYCODE_SOUND: 2833,
324    KEYCODE_QUESTION: 2834,
325    KEYCODE_CONNECT: 2836,
326    KEYCODE_SPORT: 2837,
327    KEYCODE_SHOP: 2838,
328    KEYCODE_ALTERASE: 2839,
329    KEYCODE_SWITCHVIDEOMODE: 2841,
330    KEYCODE_BATTERY: 2842,
331    KEYCODE_BLUETOOTH: 2843,
332    KEYCODE_WLAN: 2844,
333    KEYCODE_UWB: 2845,
334    KEYCODE_WWAN_WIMAX: 2846,
335    KEYCODE_RFKILL: 2847,
336    KEYCODE_CHANNEL: 3001,
337    KEYCODE_BTN_0: 3100,
338    KEYCODE_BTN_1: 3101,
339    KEYCODE_BTN_2: 3102,
340    KEYCODE_BTN_3: 3103,
341    KEYCODE_BTN_4: 3104,
342    KEYCODE_BTN_5: 3105,
343    KEYCODE_BTN_6: 3106,
344    KEYCODE_BTN_7: 3107,
345    KEYCODE_BTN_8: 3108,
346    KEYCODE_BTN_9: 3109,
347}
348
349export function mockKeyCode() {
350    const keyCode = {
351        KeyCode,
352    }
353    return keyCode;
354}