• 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 #ifndef HOS_KEY_EVENT_H
16 #define HOS_KEY_EVENT_H
17 #include "libmmi_util.h"
18 
19 namespace OHOS {
20 enum HosKeyState {
21     /**
22     * Indicates that the key is being pressed down.
23     *
24     * @since 3
25     */
26     HOS_KEY_PRESSED = 0,
27 
28     /**
29     * Indicates that the key is being released.
30     *
31     * @since 3
32     */
33     HOS_KEY_RELEASED = 1,
34 };
35 
36 enum HosKeyEventEnum {
37     /**
38     * Keycode constant: unknown keycode
39     * <p>The keycode is unknown.
40     *
41     * @since 1
42     */
43     HOS_UNKNOWN_KEY_BASE = 10000,
44     HOS_KEY_UNKNOWN = -1,
45     /**
46     * Keycode constant: Home key
47     * <p>This key is processed by the framework and will never be sent to the application.
48     *
49     * @since 1
50     */
51     HOS_KEY_HOME = 1,
52 
53     /**
54     * Keycode constant: Back key
55     *
56     * @since 1
57     */
58     HOS_KEY_BACK = 2,
59 
60     /**
61     * Keycode constant: Call key
62     *
63     * @since 1
64     */
65     HOS_KEY_CALL = 3,
66 
67     /**
68     * Keycode constant: End Call key
69     *
70     * @since 1
71     */
72     HOS_KEY_ENDCALL = 4,
73 
74     /**
75     * Keycode constant: Clear key
76     *
77     * @since 1
78     */
79     HOS_KEY_CLEAR = 5,
80 
81     /**
82     * Keycode constant: Headset Hook key
83     * <p>The key is used to end a call and stop media.
84     *
85     * @since 1
86     */
87     HOS_KEY_HEADSETHOOK = 6,
88 
89     /**
90     * Keycode constant: Camera Focus key
91     * <p>This key is used to enable focus for the camera.
92     *
93     * @since 1
94     */
95     HOS_KEY_FOCUS = 7,
96 
97     /**
98     * Keycode constant: Notification key
99     *
100     * @since 1
101     */
102     HOS_KEY_NOTIFICATION = 8,
103 
104     /**
105     * Keycode constant: Search key
106     *
107     * @since 1
108     */
109     HOS_KEY_SEARCH = 9,
110 
111     /**
112     * Keycode constant: Play/Pause media key
113     *
114     * @since 1
115     */
116     HOS_KEY_MEDIA_PLAY_PAUSE = 10,
117 
118     /**
119     * Keycode constant: Stop media key
120     *
121     * @since 1
122     */
123     HOS_KEY_MEDIA_STOP = 11,
124 
125     /**
126     * Keycode constant: Play Next media key
127     *
128     * @since 1
129     */
130     HOS_KEY_MEDIA_NEXT = 12,
131 
132     /**
133     * Keycode constant: Play Previous media key
134     *
135     * @since 1
136     */
137     HOS_KEY_MEDIA_PREVIOUS = 13,
138 
139     /**
140     * Keycode constant: Rewind media key
141     *
142     * @since 1
143     */
144     HOS_KEY_MEDIA_REWIND = 14,
145 
146     /**
147     * Keycode constant: Fast Forward media key
148     *
149     * @since 1
150     */
151     HOS_KEY_MEDIA_FAST_FORWARD = 15,
152 
153     /**
154     * Turns up the volume.
155     *
156     * @since 1
157     */
158     HOS_KEY_VOLUME_UP = 16,
159 
160     /**
161     * Turns down the volume.
162     *
163     * @since 1
164     */
165     HOS_KEY_VOLUME_DOWN = 17,
166 
167     /**
168     * Presses the power button.
169     *
170     * @since 1
171     */
172     HOS_KEY_POWER = 18,
173 
174     /**
175     * Presses the camera key.
176     * <p>It is used to start the camera or take photos.
177     *
178     * @since 1
179     */
180     HOS_KEY_CAMERA = 19,
181 
182     /**
183     * Voice Assistant key
184     * <p>This key is used to wake up the voice assistant.
185     *
186     * @since 1
187     */
188     HOS_KEY_VOICE_ASSISTANT = 20,
189 
190     /**
191     * Custom key 1
192     * <p>The actions mapping to the custom keys are user-defined. Key values 521-529 are reserved for custom keys.
193     *
194     * @since 1
195     */
196     HOS_KEY_CUSTOM1 = 21,
197 
198     HOS_KEY_VOLUME_MUTE = 22,
199     HOS_KEY_MUTE = 23,
200 
201     /**
202     * Brightness UP key
203     *
204     * @since 1
205     */
206     HOS_KEY_BRIGHTNESS_UP = 40,
207 
208     /**
209     * Brightness Down key
210     *
211     * @since 1
212     */
213     HOS_KEY_BRIGHTNESS_DOWN = 41,
214 
215     /**
216     * Indicates general-purpose key 1 on the wearables
217     *
218     * @since 3
219     */
220     HOS_KEY_WEAR_1 = 1001,
221 
222     /**
223     * Keycode constant: '0' key
224     *
225     * @since 1
226     */
227     HOS_KEY_0 = 2000,
228 
229     /**
230     * Keycode constant: '1' key
231     *
232     * @since 1
233     */
234     HOS_KEY_1 = 2001,
235 
236     /**
237     * Keycode constant: '2' key
238     *
239     * @since 1
240     */
241     HOS_KEY_2 = 2002,
242 
243     /**
244     * Keycode constant: '3' key
245     *
246     * @since 1
247     */
248     HOS_KEY_3 = 2003,
249 
250     /**
251     * Keycode constant: '4' key
252     *
253     * @since 1
254     */
255     HOS_KEY_4 = 2004,
256 
257     /**
258     * Keycode constant: '5' key
259     *
260     * @since 1
261     */
262     HOS_KEY_5 = 2005,
263 
264     /**
265     * Keycode constant: '6' key
266     *
267     * @since 1
268     */
269     HOS_KEY_6 = 2006,
270 
271     /**
272     * Keycode constant: '7' key
273     *
274     * @since 1
275     */
276     HOS_KEY_7 = 2007,
277 
278     /**
279     * Keycode constant: '8' key
280     *
281     * @since 1
282     */
283     HOS_KEY_8 = 2008,
284 
285     /**
286     * Keycode constant: '9' key
287     *
288     * @since 1
289     */
290     HOS_KEY_9 = 2009,
291 
292     /**
293     * Keycode constant: '*' key
294     *
295     * @since 1
296     */
297     HOS_KEY_STAR = 2010,
298 
299     /**
300     * Keycode constant: '#' key
301     *
302     * @since 1
303     */
304     HOS_KEY_POUND = 2011,
305 
306     /**
307     * Keycode constant: Directional Pad Up key
308     * <p>The key may also be synthesized from trackball motions.
309     *
310     * @since 1
311     */
312     HOS_KEY_DPAD_UP = 2012,
313 
314     /**
315     * Keycode constant: Directional Pad Down key
316     * <p>The key may also be synthesized from trackball motions.
317     *
318     * @since 1
319     */
320     HOS_KEY_DPAD_DOWN = 2013,
321 
322     /**
323     * Keycode constant: Directional Pad Left key
324     * <p>The key may also be synthesized from trackball motions.
325     *
326     * @since 1
327     */
328     HOS_KEY_DPAD_LEFT = 2014,
329 
330     /**
331     * Keycode constant: Directional Pad Right key
332     * <p>The key may also be synthesized from trackball motions.
333     *
334     * @since 1
335     */
336     HOS_KEY_DPAD_RIGHT = 2015,
337 
338     /**
339     * Keycode constant: Directional Pad Center key
340     * <p>The key may also be synthesized from trackball motions.
341     *
342     * @since 1
343     */
344     HOS_KEY_DPAD_CENTER = 2016,
345 
346     /**
347     * Keycode constant: 'A' key
348     *
349     * @since 1
350     */
351     HOS_KEY_A = 2017,
352 
353     /**
354     * Keycode constant: 'B' key
355     *
356     * @since 1
357     */
358     HOS_KEY_B = 2018,
359 
360     /**
361     * Keycode constant: 'C' key
362     *
363     * @since 1
364     */
365     HOS_KEY_C = 2019,
366 
367     /**
368     * Keycode constant: 'D' key
369     *
370     * @since 1
371     */
372     HOS_KEY_D = 2020,
373 
374     /**
375     * Keycode constant: 'E' key
376     *
377     * @since 1
378     */
379     HOS_KEY_E = 2021,
380 
381     /**
382     * Keycode constant: 'F' key
383     *
384     * @since 1
385     */
386     HOS_KEY_F = 2022,
387 
388     /**
389     * Keycode constant: 'G' key
390     *
391     * @since 1
392     */
393     HOS_KEY_G = 2023,
394 
395     /**
396     * Keycode constant: 'H' key
397     *
398     * @since 1
399     */
400     HOS_KEY_H = 2024,
401 
402     /**
403     * Keycode constant: 'I' key
404     *
405     * @since 1
406     */
407     HOS_KEY_I = 2025,
408 
409     /**
410     * Keycode constant: 'J' key
411     *
412     * @since 1
413     */
414     HOS_KEY_J = 2026,
415 
416     /**
417     * Keycode constant: 'K' key
418     *
419     * @since 1
420     */
421     HOS_KEY_K = 2027,
422 
423     /**
424     * Keycode constant: 'L' key
425     *
426     * @since 1
427     */
428     HOS_KEY_L = 2028,
429 
430     /**
431     * Keycode constant: 'M' key
432     *
433     * @since 1
434     */
435     HOS_KEY_M = 2029,
436 
437     /**
438     * Keycode constant: 'N' key
439     *
440     * @since 1
441     */
442     HOS_KEY_N = 2030,
443 
444     /**
445     * Keycode constant: 'O' key
446     *
447     * @since 1
448     */
449     HOS_KEY_O = 2031,
450 
451     /**
452     * Keycode constant: 'P' key
453     *
454     * @since 1
455     */
456     HOS_KEY_P = 2032,
457 
458     /**
459     * Keycode constant: 'Q' key
460     *
461     * @since 1
462     */
463     HOS_KEY_Q = 2033,
464 
465     /**
466     * Keycode constant: 'R' key
467     *
468     * @since 1
469     */
470     HOS_KEY_R = 2034,
471 
472     /**
473     * Keycode constant: 'S' key
474     *
475     * @since 1
476     */
477     HOS_KEY_S = 2035,
478 
479     /**
480     * Keycode constant: 'T' key
481     *
482     * @since 1
483     */
484     HOS_KEY_T = 2036,
485 
486     /**
487     * Keycode constant: 'U' key
488     *
489     * @since 1
490     */
491     HOS_KEY_U = 2037,
492 
493     /**
494     * Keycode constant: 'V' key
495     *
496     * @since 1
497     */
498     HOS_KEY_V = 2038,
499 
500     /**
501     * Keycode constant: 'W' key
502     *
503     * @since 1
504     */
505     HOS_KEY_W = 2039,
506 
507     /**
508     * Keycode constant: 'X' key
509     *
510     * @since 1
511     */
512     HOS_KEY_X = 2040,
513 
514     /**
515     * Keycode constant: 'Y' key
516     *
517     * @since 1
518     */
519     HOS_KEY_Y = 2041,
520 
521     /**
522     * Keycode constant: 'Z' key
523     *
524     * @since 1
525     */
526     HOS_KEY_Z = 2042,
527 
528     /**
529     * Keycode constant: ',' key
530     *
531     * @since 1
532     */
533     HOS_KEY_COMMA = 2043,
534 
535     /**
536     * Keycode constant: '.' key
537     *
538     * @since 1
539     */
540     HOS_KEY_PERIOD = 2044,
541 
542     /**
543     * Keycode constant: Left Alt modifier key
544     *
545     * @since 1
546     */
547     HOS_KEY_ALT_LEFT = 2045,
548 
549     /**
550     * Keycode constant: Right Alt modifier key
551     *
552     * @since 1
553     */
554     HOS_KEY_ALT_RIGHT = 2046,
555 
556     /**
557     * Keycode constant: Left Shift modifier key
558     *
559     * @since 1
560     */
561     HOS_KEY_SHIFT_LEFT = 2047,
562 
563     /**
564     * Keycode constant: Right Shift modifier key
565     *
566     * @since 1
567     */
568     HOS_KEY_SHIFT_RIGHT = 2048,
569 
570     /**
571     * Keycode constant: Tab key
572     *
573     * @since 1
574     */
575     HOS_KEY_TAB = 2049,
576 
577     /**
578     * Keycode constant: Space key
579     *
580     * @since 1
581     */
582     HOS_KEY_SPACE = 2050,
583 
584     /**
585     * Keycode constant: Symbol modifier key
586     * <p>The key is used to input alternate symbols.
587     *
588     * @since 1
589     */
590     HOS_KEY_SYM = 2051,
591 
592     /**
593     * Keycode constant: Explorer function key
594     * <p>This key is used to launch a browser application.
595     *
596     * @since 1
597     */
598     HOS_KEY_EXPLORER = 2052,
599 
600     /**
601     * Keycode constant: Email function key
602     * <p>This key is used to launch an email application.
603     *
604     * @since 1
605     */
606     HOS_KEY_ENVELOPE = 2053,
607 
608     /**
609     * Keycode constant: Enter key
610     *
611     * @since 1
612     */
613     HOS_KEY_ENTER = 2054,
614 
615     /**
616     * Keycode constant: Backspace key
617     * <p>Unlike {@link #KEY_FORWARD_DEL}, this key is used to delete characters before the
618     * insertion point.
619     *
620     * @since 1
621     */
622     HOS_KEY_DEL = 2055,
623 
624     /**
625     * Keycode constant: '`' key (backtick key)
626     *
627     * @since 1
628     */
629     HOS_KEY_GRAVE = 2056,
630 
631     /**
632     * Keycode constant: '-' key
633     *
634     * @since 1
635     */
636     HOS_KEY_MINUS = 2057,
637 
638     /**
639     * Keycode constant: '=' key
640     *
641     * @since 1
642     */
643     HOS_KEY_EQUALS = 2058,
644 
645     /**
646     * Keycode constant: '[' key
647     *
648     * @since 1
649     */
650     HOS_KEY_LEFT_BRACKET = 2059,
651 
652     /**
653     * Keycode constant: ']' key
654     *
655     * @since 1
656     */
657     HOS_KEY_RIGHT_BRACKET = 2060,
658 
659     /**
660     * Keycode constant: '\' key
661     *
662     * @since 1
663     */
664     HOS_KEY_BACKSLASH = 2061,
665 
666     /**
667     * Keycode constant: ',' key
668     *
669     * @since 1
670     */
671     HOS_KEY_SEMICOLON = 2062,
672 
673     /**
674     * Keycode constant: ''' key (apostrophe key)
675     *
676     * @since 1
677     */
678     HOS_KEY_APOSTROPHE = 2063,
679 
680     /**
681     * Keycode constant: '/' key
682     *
683     * @since 1
684     */
685     HOS_KEY_SLASH = 2064,
686 
687     /**
688     * Keycode constant: '{@literal @}' key
689     *
690     * @since 1
691     */
692     HOS_KEY_AT = 2065,
693 
694     /**
695     * Keycode constant: '+' key
696     *
697     * @since 1
698     */
699     HOS_KEY_PLUS = 2066,
700 
701     /**
702     * Keycode constant: Menu key
703     *
704     * @since 1
705     */
706     HOS_KEY_MENU = 2067,
707 
708     /**
709     * Keycode constant: Page Up key
710     *
711     * @since 1
712     */
713     HOS_KEY_PAGE_UP = 2068,
714 
715     /**
716     * Keycode constant: Page Down key
717     *
718     * @since 1
719     */
720     HOS_KEY_PAGE_DOWN = 2069,
721 
722     /**
723     * Keycode constant: Escape key
724     *
725     * @since 1
726     */
727     HOS_KEY_ESCAPE = 2070,
728 
729     /**
730     * Keycode constant: Forward Delete key
731     * <p>Unlike {@link #KEY_DEL}, this key is used to delete characters ahead of the insertion
732     * point.
733     *
734     * @since 1
735     */
736     HOS_KEY_FORWARD_DEL = 2071,
737 
738     /**
739     * Keycode constant: Left Control modifier key
740     *
741     * @since 1
742     */
743     HOS_KEY_CTRL_LEFT = 2072,
744 
745     /**
746     * Keycode constant: Right Control modifier key
747     *
748     * @since 1
749     */
750     HOS_KEY_CTRL_RIGHT = 2073,
751 
752     /**
753     * Keycode constant: Caps Lock key
754     *
755     * @since 1
756     */
757     HOS_KEY_CAPS_LOCK = 2074,
758 
759     /**
760     * Keycode constant: Scroll Lock key
761     *
762     * @since 1
763     */
764     HOS_KEY_SCROLL_LOCK = 2075,
765 
766     /**
767     * Keycode constant: Left Meta modifier key
768     *
769     * @since 1
770     */
771     HOS_KEY_META_LEFT = 2076,
772 
773     /**
774     * Keycode constant: Right Meta modifier key
775     *
776     * @since 1
777     */
778     HOS_KEY_META_RIGHT = 2077,
779 
780     /**
781     * Keycode constant: Function modifier key
782     *
783     * @since 1
784     */
785     HOS_KEY_FUNCTION = 2078,
786 
787     /**
788     * Keycode constant: System Request/Print Screen key
789     *
790     * @since 1
791     */
792     HOS_KEY_SYSRQ = 2079,
793 
794     /**
795     * Keycode constant: Break/Pause key
796     *
797     * @since 1
798     */
799     HOS_KEY_BREAK = 2080,
800 
801     /**
802     * Keycode constant: Home Movement key
803     * <p>This key is used to scroll or move the cursor around to the start of a line or to the
804     * top of a list.
805     *
806     * @since 1
807     */
808     HOS_KEY_MOVE_HOME = 2081,
809 
810     /**
811     * Keycode constant: End Movement key
812     * <p>This key is used to scroll or move the cursor around to the end of a line or to the
813     * bottom of a list.
814     *
815     * @since 1
816     */
817     HOS_KEY_MOVE_END = 2082,
818 
819     /**
820     * Keycode constant: Insert key
821     * <p>This key is used to toggle the insert or overwrite edit mode.
822     *
823     * @since 1
824     */
825     HOS_KEY_INSERT = 2083,
826 
827     /**
828     * Keycode constant: Forward key
829     * <p>This key is used to navigate forward in the history stack. It is a complement of
830     * {@link #KEY_BACK}.
831     *
832     * @since 1
833     */
834     HOS_KEY_FORWARD = 2084,
835 
836     /**
837     * Keycode constant: Play media key
838     *
839     * @since 1
840     */
841     HOS_KEY_MEDIA_PLAY = 2085,
842 
843     /**
844     * Keycode constant: Pause media key
845     *
846     * @since 1
847     */
848     HOS_KEY_MEDIA_PAUSE = 2086,
849 
850     /**
851     * Keycode constant: Close media key
852     * <p>This key can be used to close a CD tray, for example.
853     *
854     * @since 1
855     */
856     HOS_KEY_MEDIA_CLOSE = 2087,
857 
858     /**
859     * Keycode constant: Eject media key
860     * <p>This key can be used to eject a CD tray, for example.
861     *
862     * @since 1
863     */
864     HOS_KEY_MEDIA_EJECT = 2088,
865 
866     /**
867     * Keycode constant: Record media key
868     *
869     * @since 1
870     */
871     HOS_KEY_MEDIA_RECORD = 2089,
872 
873     /**
874     * Keycode constant: F1 key
875     *
876     * @since 1
877     */
878     HOS_KEY_F1 = 2090,
879 
880     /**
881     * Keycode constant: F2 key
882     *
883     * @since 1
884     */
885     HOS_KEY_F2 = 2091,
886 
887     /**
888     * Keycode constant: F3 key
889     *
890     * @since 1
891     */
892     HOS_KEY_F3 = 2092,
893 
894     /**
895     * Keycode constant: F4 key
896     *
897     * @since 1
898     */
899     HOS_KEY_F4 = 2093,
900 
901     /**
902     * Keycode constant: F5 key
903     *
904     * @since 1
905     */
906     HOS_KEY_F5 = 2094,
907 
908     /**
909     * Keycode constant: F6 key
910     *
911     * @since 1
912     */
913     HOS_KEY_F6 = 2095,
914 
915     /**
916     * Keycode constant: F7 key
917     *
918     * @since 1
919     */
920     HOS_KEY_F7 = 2096,
921 
922     /**
923     * Keycode constant: F8 key
924     *
925     * @since 1
926     */
927     HOS_KEY_F8 = 2097,
928 
929     /**
930     * Keycode constant: F9 key
931     *
932     * @since 1
933     */
934     HOS_KEY_F9 = 2098,
935 
936     /**
937     * Keycode constant: F10 key
938     *
939     * @since 1
940     */
941     HOS_KEY_F10 = 2099,
942 
943     /**
944     * Keycode constant: F11 key
945     *
946     * @since 1
947     */
948     HOS_KEY_F11 = 2100,
949 
950     /**
951     * Keycode constant: F12 key
952     *
953     * @since 1
954     */
955     HOS_KEY_F12 = 2101,
956 
957     /**
958     * Keycode constant: Num Lock key
959     * <p>This key is used to alter the behavior of other keys on the numeric keypad.
960     *
961     * @since 1
962     */
963     HOS_KEY_NUM_LOCK = 2102,
964 
965     /**
966     * Keycode constant: '0' key on the numeric keypad
967     *
968     * @since 1
969     */
970     HOS_KEY_NUMPAD_0 = 2103,
971 
972     /**
973     * Keycode constant: '1' key on the numeric keypad
974     *
975     * @since 1
976     */
977     HOS_KEY_NUMPAD_1 = 2104,
978 
979     /**
980     * Keycode constant: '2' key on the numeric keypad
981     *
982     * @since 1
983     */
984     HOS_KEY_NUMPAD_2 = 2105,
985 
986     /**
987     * Keycode constant: '3' key on the numeric keypad
988     *
989     * @since 1
990     */
991     HOS_KEY_NUMPAD_3 = 2106,
992 
993     /**
994     * Keycode constant: '4' key on the numeric keypad
995     *
996     * @since 1
997     */
998     HOS_KEY_NUMPAD_4 = 2107,
999 
1000     /**
1001     * Keycode constant: '5' key on the numeric keypad
1002     *
1003     * @since 1
1004     */
1005     HOS_KEY_NUMPAD_5 = 2108,
1006 
1007     /**
1008     * Keycode constant: '6' key on the numeric keypad
1009     *
1010     * @since 1
1011     */
1012     HOS_KEY_NUMPAD_6 = 2109,
1013 
1014     /**
1015     * Keycode constant: '7' key on the numeric keypad
1016     *
1017     * @since 1
1018     */
1019     HOS_KEY_NUMPAD_7 = 2110,
1020 
1021     /**
1022     * Keycode constant: '8' key on the numeric keypad
1023     *
1024     * @since 1
1025     */
1026     HOS_KEY_NUMPAD_8 = 2111,
1027 
1028     /**
1029     * Keycode constant: '9' key on the numeric keypad
1030     *
1031     * @since 1
1032     */
1033     HOS_KEY_NUMPAD_9 = 2112,
1034 
1035     /**
1036     * Keycode constant: '/' key (for division) on the numeric keypad
1037     *
1038     * @since 1
1039     */
1040     HOS_KEY_NUMPAD_DIVIDE = 2113,
1041 
1042     /**
1043     * Keycode constant: '*' key (for multiplication) on the numeric keypad
1044     *
1045     * @since 1
1046     */
1047     HOS_KEY_NUMPAD_MULTIPLY = 2114,
1048 
1049     /**
1050     * Keycode constant: '-' key (for subtraction) on the numeric keypad
1051     *
1052     * @since 1
1053     */
1054     HOS_KEY_NUMPAD_SUBTRACT = 2115,
1055 
1056     /**
1057     * Keycode constant: '+' key (for addition) on the numeric keypad
1058     *
1059     * @since 1
1060     */
1061     HOS_KEY_NUMPAD_ADD = 2116,
1062 
1063     /**
1064     * Key code constant: '.' key (for decimals or digit grouping) on the numeric keypad
1065     *
1066     * @since 1
1067     */
1068     HOS_KEY_NUMPAD_DOT = 2117,
1069 
1070     /**
1071     * Key code constant: ',' key (for decimals or digit grouping) on the numeric keypad
1072     *
1073     * @since 1
1074     */
1075     HOS_KEY_NUMPAD_COMMA = 2118,
1076 
1077     /**
1078     * Keycode constant: Enter key on the numeric keypad
1079     *
1080     * @since 1
1081     */
1082     HOS_KEY_NUMPAD_ENTER = 2119,
1083 
1084     /**
1085     * Keycode constant: '=' key on the numeric keypad
1086     *
1087     * @since 1
1088     */
1089     HOS_KEY_NUMPAD_EQUALS = 2120,
1090 
1091     /**
1092     * Keycode constant: '(' key on the numeric keypad
1093     *
1094     * @since 1
1095     */
1096     HOS_KEY_NUMPAD_LEFT_PAREN = 2121,
1097 
1098     /**
1099     * Keycode constant: ')' key on the numeric keypad
1100     *
1101     * @since 1
1102     */
1103     HOS_KEY_NUMPAD_RIGHT_PAREN = 2122,
1104 
1105     /**
1106     * Key code:  The virtual multitask key
1107     *
1108     * @since 1
1109     */
1110     HOS_KEY_VIRTUAL_MULTITASK = 2210,
1111 
1112     HOS_KEY_SLEEP = 2600,
1113     HOS_KEY_ZENKAKU_HANKAKU = 2601,
1114     HOS_KEY_102ND = 2602,
1115     HOS_KEY_RO = 2603,
1116     HOS_KEY_KATAKANA = 2604,
1117     HOS_KEY_HIRAGANA = 2605,
1118     HOS_KEY_HENKAN = 2606,
1119     HOS_KEY_KATAKANA_HIRAGANA = 2607,
1120     HOS_KEY_MUHENKAN = 2608,
1121     HOS_KEY_LINEFEED = 2609,
1122     HOS_KEY_MACRO = 2610,
1123     HOS_KEY_NUMPAD_PLUSMINUS = 2611,
1124     HOS_KEY_SCALE = 2612,
1125     HOS_KEY_HANGUEL = 2613,
1126     HOS_KEY_HANJA = 2614,
1127     HOS_KEY_YEN = 2615,
1128     HOS_KEY_STOP = 2616,
1129     HOS_KEY_AGAIN = 2617,
1130     HOS_KEY_PROPS = 2618,
1131     HOS_KEY_UNDO = 2619,
1132     HOS_KEY_COPY = 2620,
1133     HOS_KEY_OPEN = 2621,
1134     HOS_KEY_PASTE = 2622,
1135     HOS_KEY_FIND = 2623,
1136     HOS_KEY_CUT = 2624,
1137     HOS_KEY_HELP = 2625,
1138     HOS_KEY_CALC = 2626,
1139     HOS_KEY_FILE = 2627,
1140     HOS_KEY_BOOKMARKS = 2628,
1141     HOS_KEY_NEXT = 2629,
1142     HOS_KEY_PLAYPAUSE = 2630,
1143     HOS_KEY_PREVIOUS = 2631,
1144     HOS_KEY_STOPCD = 2632,
1145     HOS_KEY_CONFIG = 2634,
1146     HOS_KEY_REFRESH = 2635,
1147     HOS_KEY_EXIT = 2636,
1148     HOS_KEY_EDIT = 2637,
1149     HOS_KEY_SCROLLUP = 2638,
1150     HOS_KEY_SCROLLDOWN = 2639,
1151     HOS_KEY_NEW = 2640,
1152     HOS_KEY_REDO = 2641,
1153     HOS_KEY_CLOSE = 2642,
1154     HOS_KEY_PLAY = 2643,
1155     HOS_KEY_BASSBOOST = 2644,
1156     HOS_KEY_PRINT = 2645,
1157     HOS_KEY_CHAT = 2646,
1158     HOS_KEY_FINANCE = 2647,
1159     HOS_KEY_CANCEL = 2648,
1160     HOS_KEY_KBDILLUM_TOGGLE = 2649,
1161     HOS_KEY_KBDILLUM_DOWN = 2650,
1162     HOS_KEY_KBDILLUM_UP = 2651,
1163     HOS_KEY_SEND = 2652,
1164     HOS_KEY_REPLY = 2653,
1165     HOS_KEY_FORWARDMAIL = 2654,
1166     HOS_KEY_SAVE = 2655,
1167     HOS_KEY_DOCUMENTS = 2656,
1168     HOS_KEY_VIDEO_NEXT = 2657,
1169     HOS_KEY_VIDEO_PREV = 2658,
1170     HOS_KEY_BRIGHTNESS_CYCLE = 2659,
1171     HOS_KEY_BRIGHTNESS_ZERO = 2660,
1172     HOS_KEY_DISPLAY_OFF = 2661,
1173     HOS_BTN_MISC = 2662,
1174     HOS_KEY_GOTO = 2663,
1175     HOS_KEY_INFO = 2664,
1176     HOS_KEY_PROGRAM = 2665,
1177     HOS_KEY_PVR = 2666,
1178     HOS_KEY_SUBTITLE = 2667,
1179     HOS_KEY_FULL_SCREEN = 2668,
1180     HOS_KEY_KEYBOARD = 2669,
1181     HOS_KEY_ASPECT_RATIO = 2670,
1182     HOS_KEY_PC = 2671,
1183     HOS_KEY_TV = 2672,
1184     HOS_KEY_TV2 = 2673,
1185     HOS_KEY_VCR = 2674,
1186     HOS_KEY_VCR2 = 2675,
1187     HOS_KEY_SAT = 2676,
1188     HOS_KEY_CD = 2677,
1189     HOS_KEY_TAPE = 2678,
1190     HOS_KEY_TUNER = 2679,
1191     HOS_KEY_PLAYER = 2680,
1192     HOS_KEY_DVD = 2681,
1193     HOS_KEY_AUDIO = 2682,
1194     HOS_KEY_VIDEO = 2683,
1195     HOS_KEY_MEMO = 2684,
1196     HOS_KEY_CALENDAR = 2685,
1197     HOS_KEY_RED = 2686,
1198     HOS_KEY_GREEN = 2687,
1199     HOS_KEY_YELLOW = 2688,
1200     HOS_KEY_BLUE = 2689,
1201     HOS_KEY_CHANNELUP = 2690,
1202     HOS_KEY_CHANNELDOWN = 2691,
1203     HOS_KEY_LAST = 2692,
1204     HOS_KEY_RESTART = 2693,
1205     HOS_KEY_SLOW = 2694,
1206     HOS_KEY_SHUFFLE = 2695,
1207     HOS_KEY_VIDEOPHONE = 2696,
1208     HOS_KEY_GAMES = 2697,
1209     HOS_KEY_ZOOMIN = 2698,
1210     HOS_KEY_ZOOMOUT = 2699,
1211     HOS_KEY_ZOOMRESET = 2700,
1212     HOS_KEY_WORDPROCESSOR = 2701,
1213     HOS_KEY_EDITOR = 2702,
1214     HOS_KEY_SPREADSHEET = 2703,
1215     HOS_KEY_GRAPHICSEDITOR = 2704,
1216     HOS_KEY_PRESENTATION = 2705,
1217     HOS_KEY_DATABASE = 2706,
1218     HOS_KEY_NEWS = 2707,
1219     HOS_KEY_VOICEMAIL = 2708,
1220     HOS_KEY_ADDRESSBOOK = 2709,
1221     HOS_KEY_MESSENGER = 2710,
1222     HOS_KEY_BRIGHTNESS_TOGGLE = 2711,
1223     HOS_KEY_SPELLCHECK = 2712,
1224     HOS_KEY_COFFEE = 2713,
1225     HOS_KEY_MEDIA_REPEAT = 2714,
1226     HOS_KEY_IMAGES = 2715,
1227     HOS_KEY_BUTTONCONFIG = 2716,
1228     HOS_KEY_TASKMANAGER = 2717,
1229     HOS_KEY_JOURNAL = 2718,
1230     HOS_KEY_CONTROLPANEL = 2719,
1231     HOS_KEY_APPSELECT = 2720,
1232     HOS_KEY_SCREENSAVER = 2721,
1233     HOS_KEY_ASSISTANT = 2722,
1234     HOS_KEY_KBD_LAYOUT_NEXT = 2723,
1235     HOS_KEY_BRIGHTNESS_MIN = 2724,
1236     HOS_KEY_BRIGHTNESS_MAX = 2725,
1237     HOS_KEY_KBDINPUTASSIST_PREV = 2726,
1238     HOS_KEY_KBDINPUTASSIST_NEXT = 2727,
1239     HOS_KEY_KBDINPUTASSIST_PREVGROUP = 2728,
1240     HOS_KEY_KBDINPUTASSIST_NEXTGROUP = 2729,
1241     HOS_KEY_KBDINPUTASSIST_ACCEPT = 2730,
1242     HOS_KEY_KBDINPUTASSIST_CANCEL = 2731,
1243 
1244     HOS_KEY_FRONT = 2800,
1245     HOS_KEY_SETUP = 2801,
1246     HOS_KEY_WAKEUP = 2802,
1247     HOS_KEY_SENDFILE = 2803,
1248     HOS_KEY_DELETEFILE = 2804,
1249     HOS_KEY_XFER = 2805,
1250     HOS_KEY_PROG1 = 2806,
1251     HOS_KEY_PROG2 = 2807,
1252     HOS_KEY_MSDOS = 2808,
1253     HOS_KEY_SCREENLOCK = 2809,
1254     HOS_KEY_DIRECTION_ROTATE_DISPLAY = 2810,
1255     HOS_KEY_CYCLEWINDOWS = 2811,
1256     HOS_KEY_COMPUTER = 2812,
1257     HOS_KEY_EJECTCLOSECD = 2813,
1258     HOS_KEY_ISO = 2814,
1259     HOS_KEY_MOVE = 2815,
1260     HOS_KEY_F13 = 2816,
1261     HOS_KEY_F14 = 2817,
1262     HOS_KEY_F15 = 2818,
1263     HOS_KEY_F16 = 2819,
1264     HOS_KEY_F17 = 2820,
1265     HOS_KEY_F18 = 2821,
1266     HOS_KEY_F19 = 2822,
1267     HOS_KEY_F20 = 2823,
1268     HOS_KEY_F21 = 2824,
1269     HOS_KEY_F22 = 2825,
1270     HOS_KEY_F23 = 2826,
1271     HOS_KEY_F24 = 2827,
1272     HOS_KEY_PROG3 = 2828,
1273     HOS_KEY_PROG4 = 2829,
1274     HOS_KEY_DASHBOARD = 2830,
1275     HOS_KEY_SUSPEND = 2831,
1276     HOS_KEY_HP = 2832,
1277     HOS_KEY_SOUND = 2833,
1278     HOS_KEY_QUESTION = 2834,
1279     HOS_KEY_CONNECT = 2836,
1280     HOS_KEY_SPORT = 2837,
1281     HOS_KEY_SHOP = 2838,
1282     HOS_KEY_ALTERASE = 2839,
1283     HOS_KEY_SWITCHVIDEOMODE = 2841,
1284     HOS_KEY_BATTERY = 2842,
1285     HOS_KEY_BLUETOOTH = 2843,
1286     HOS_KEY_WLAN = 2844,
1287     HOS_KEY_UWB = 2845,
1288     HOS_KEY_WWAN_WIMAX = 2846,
1289     HOS_KEY_RFKILL = 2847,
1290 
1291     HOS_KEY_CHANNEL = 3001,
1292     HOS_KEY_BTN_0 = 3100,
1293     HOS_KEY_BTN_1 = 3101,
1294     HOS_KEY_BTN_2 = 3102,
1295     HOS_KEY_BTN_3 = 3103,
1296     HOS_KEY_BTN_4 = 3104,
1297     HOS_KEY_BTN_5 = 3105,
1298     HOS_KEY_BTN_6 = 3106,
1299     HOS_KEY_BTN_7 = 3107,
1300     HOS_KEY_BTN_8 = 3108,
1301     HOS_KEY_BTN_9 = 3109,
1302 
1303     HOS_KEY_BRL_DOT1 = 3201,
1304     HOS_KEY_BRL_DOT2 = 3202,
1305     HOS_KEY_BRL_DOT3 = 3203,
1306     HOS_KEY_BRL_DOT4 = 3204,
1307     HOS_KEY_BRL_DOT5 = 3205,
1308     HOS_KEY_BRL_DOT6 = 3206,
1309     HOS_KEY_BRL_DOT7 = 3207,
1310     HOS_KEY_BRL_DOT8 = 3208,
1311     HOS_KEY_BRL_DOT9 = 3209,
1312     HOS_KEY_BRL_DOT10 = 3210,
1313 
1314     /**
1315     * Left Knob roll-up
1316     * <p>In contrast to {@link #KEY_LEFT_KNOB_ROLL_DOWN}, it means rolling the left knob upwards. The knob function
1317     * is scenario-specific, for example, increasing the volume or air conditioner temperature.
1318     *
1319     * @since 1
1320     */
1321     HOS_KEY_LEFT_KNOB_ROLL_UP = 10001,
1322 
1323     /**
1324     * Left Knob roll-down
1325     * <p>In contrast to {@link #KEY_LEFT_KNOB_ROLL_UP}, it means rolling the left knob downwards. The knob function
1326     * is scenario-specific, for example, reducing the volume or air conditioner temperature.
1327     *
1328     * @since 1
1329     */
1330     HOS_KEY_LEFT_KNOB_ROLL_DOWN = 10002,
1331 
1332     /**
1333     * Left Knob
1334     * <p>Pressing the knob will activate its adjustment function.
1335     *
1336     * @since 1
1337     */
1338     HOS_KEY_LEFT_KNOB = 10003,
1339 
1340     /**
1341     * Right Knob roll-up
1342     * <p>In contrast to {@link #KEY_RIGHT_KNOB_ROLL_DOWN}, it means rolling the right knob upwards. The knob
1343     * function is scenario-specific, for example, increasing the volume or air conditioner temperature.
1344     *
1345     * @since 1
1346     */
1347     HOS_KEY_RIGHT_KNOB_ROLL_UP = 10004,
1348 
1349     /**
1350     * Right Knob roll-down
1351     * <p>In contrast to {@link #KEY_RIGHT_KNOB_ROLL_UP}, it means rolling the right knob downwards. The knob
1352     * function is scenario-specific, for example, reducing the volume or air conditioner temperature.
1353     *
1354     * @since 1
1355     */
1356     HOS_KEY_RIGHT_KNOB_ROLL_DOWN = 10005,
1357 
1358     /**
1359     * Right Knob
1360     * <p>Pressing the knob will activate its adjustment function.
1361     *
1362     * @since 1
1363     */
1364     HOS_KEY_RIGHT_KNOB = 10006,
1365 
1366     /**
1367     * Audio Source Switch button
1368     * <p>Pressing this button will enable the audio source. Depending on the actual scenario, it may also
1369     * indicate that the Bluetooth call control button is pressed.
1370     *
1371     * @since 1
1372     */
1373     HOS_KEY_VOICE_SOURCE_SWITCH = 10007,
1374 
1375     /**
1376     * Menu key
1377     * <p>Pressing this key will display the launcher page.
1378     *
1379     * @since 1
1380     */
1381     HOS_KEY_LAUNCHER_MENU = 10008,
1382 
1383     /**
1384     * Keycode constant: max keycode
1385     * <p> If a new keycode added to {@code KeyEvent} is greater than the maximum keycode, update
1386     * the maximum keycode accordingly.
1387     *
1388     * @since 1
1389     */
1390     HOS_NOW_MAX_KEY = HOS_KEY_LAUNCHER_MENU
1391 };
1392 
1393 enum MouseEnum {
1394     /**
1395     * Indicates that the left button on the mouse is pressed.
1396     *
1397     * @since 1
1398     */
1399     HOS_LEFT_BUTTON = 1 << 0,
1400 
1401     /**
1402     * Indicates that the right button on the mouse is pressed.
1403     *
1404     * @since 1
1405     */
1406     HOS_RIGHT_BUTTON = 1 << 1,
1407 
1408     /**
1409     * Indicates that the middle button on the mouse is pressed.
1410     *
1411     * @since 1
1412     */
1413     HOS_MIDDLE_BUTTON = 1 << 2,
1414 
1415     /**
1416     * Indicates that the back button on the mouse is pressed.
1417     *
1418     * @since 1
1419     */
1420     HOS_BACK_BUTTON = 1 << 3,
1421 
1422     /**
1423     * Indicates that the forward button on the mouse is pressed.
1424     *
1425     * @since 1
1426     */
1427     HOS_FORWARD_BUTTON = 1 << 4,
1428 
1429     HOS_SIDE_BUTTON = 1 << 5,
1430     HOS_EXTRA_BUTTON = 1 << 6,
1431     HOS_TASK_BUTTON = 1 << 7,
1432 };
1433 
1434 enum JoystickEnum {
1435     /**
1436     * Key code of joystick:
1437     *
1438     * @since 1
1439     */
1440     HOS_KEY_BUTTON_TRIGGER = 2401,
1441 
1442     /**
1443     * Key code of joystick:
1444     *
1445     * @since 1
1446     */
1447     HOS_KEY_BUTTON_THUMB = 2402,
1448 
1449     /**
1450     * Key code of joystick:
1451     *
1452     * @since 1
1453     */
1454     HOS_KEY_BUTTON_THUMB2 = 2403,
1455 
1456     /**
1457     * Key code of joystick:
1458     *
1459     * @since 1
1460     */
1461     HOS_KEY_BUTTON_TOP = 2404,
1462 
1463     /**
1464     * Key code of joystick:
1465     *
1466     * @since 1
1467     */
1468     HOS_KEY_BUTTON_TOP2 = 2405,
1469 
1470     /**
1471     * Key code of joystick:
1472     *
1473     * @since 1
1474     */
1475     HOS_KEY_BUTTON_PINKIE = 2406,
1476 
1477     /**
1478     * Key code of joystick:
1479     *
1480     * @since 1
1481     */
1482     HOS_KEY_BUTTON_BASE1 = 2407,
1483 
1484     /**
1485     * Key code of joystick:
1486     *
1487     * @since 1
1488     */
1489     HOS_KEY_BUTTON_BASE2 = 2408,
1490 
1491     /**
1492     * Key code of joystick:
1493     *
1494     * @since 1
1495     */
1496     HOS_KEY_BUTTON_BASE3 = 2409,
1497 
1498     /**
1499     * Key code of joystick:
1500     *
1501     * @since 1
1502     */
1503     HOS_KEY_BUTTON_BASE4 = 2410,
1504 
1505     /**
1506     * Key code of joystick:
1507     *
1508     * @since 1
1509     */
1510     HOS_KEY_BUTTON_BASE5 = 2411,
1511 
1512     /**
1513     * Key code of joystick:
1514     *
1515     * @since 1
1516     */
1517     HOS_KEY_BUTTON_BASE6 = 2412,
1518 
1519     /**
1520     * Key code of joystick:
1521     *
1522     * @since 1
1523     */
1524     HOS_KEY_BUTTON_BASE7 = 2413,
1525 
1526     /**
1527     * Key code of joystick:
1528     *
1529     * @since 1
1530     */
1531     HOS_KEY_BUTTON_BASE8 = 2414,
1532 
1533     /**
1534     * Key code of joystick:
1535     *
1536     * @since 1
1537     */
1538     HOS_KEY_BUTTON_BASE9 = 2415,
1539 
1540     /**
1541     * Key code of joystick:
1542     *
1543     * @since 1
1544     */
1545     HOS_KEY_BUTTON_DEAD = 2416,
1546 };
1547 
1548 enum HandleEnum {
1549     /**
1550     * Key code of handle:
1551     *
1552     * @since 1
1553     */
1554     HOS_KEY_BUTTON_A = 2301,
1555 
1556     /**
1557     * Key code of handle:
1558     *
1559     * @since 1
1560     */
1561     HOS_KEY_BUTTON_B = 2302,
1562 
1563     /**
1564     * Key code of handle:
1565     *
1566     * @since 1
1567     */
1568     HOS_KEY_BUTTON_C = 2303,
1569 
1570     /**
1571     * Key code of handle:
1572     *
1573     * @since 1
1574     */
1575     HOS_KEY_BUTTON_X = 2304,
1576 
1577     /**
1578     * Key code of handle:
1579     *
1580     * @since 1
1581     */
1582     HOS_KEY_BUTTON_Y = 2305,
1583 
1584     /**
1585     * Key code of handle:
1586     *
1587     * @since 1
1588     */
1589     HOS_KEY_BUTTON_Z = 2306,
1590 
1591     /**
1592     * Key code of handle:
1593     *
1594     * @since 1
1595     */
1596     HOS_KEY_BUTTON_L1 = 2307,
1597 
1598     /**
1599     * Key code of handle:
1600     *
1601     * @since 1
1602     */
1603     HOS_KEY_BUTTON_R1 = 2308,
1604 
1605     /**
1606     * Key code of handle:
1607     *
1608     * @since 1
1609     */
1610     HOS_KEY_BUTTON_L2 = 2309,
1611 
1612     /**
1613     * Key code of handle:
1614     *
1615     * @since 1
1616     */
1617     HOS_KEY_BUTTON_R2 = 2310,
1618 
1619     /**
1620     * Key code of handle:
1621     *
1622     * @since 1
1623     */
1624     HOS_KEY_BUTTON_SELECT = 2311,
1625 
1626     /**
1627     * Key code of handle:
1628     *
1629     * @since 1
1630     */
1631     HOS_KEY_BUTTON_START = 2312,
1632 
1633     /**
1634     * Key code of handle:
1635     *
1636     * @since 1
1637     */
1638     HOS_KEY_BUTTON_MODE = 2313,
1639 
1640     /**
1641     * Key code of handle:
1642     *
1643     * @since 1
1644     */
1645     HOS_KEY_BUTTON_THUMBL = 2314,
1646 
1647     /**
1648     * Key code of handle:
1649     *
1650     * @since 1
1651     */
1652     HOS_KEY_BUTTON_THUMBR = 2315,
1653 };
1654 
1655 enum TouchEnum {
1656     /**
1657     * Key code of touch:
1658     *
1659     * @since 1
1660     */
1661     HOS_BUTTON_TOUCH = 2500,
1662 
1663     HOS_BUTTON_TOOL_PEN = 2501,
1664     HOS_BUTTON_TOOL_RUBBER = 2502,
1665     HOS_BUTTON_TOOL_BRUSH = 2503,
1666     HOS_BUTTON_TOOL_PENCIL = 2504,
1667     HOS_BUTTON_TOOL_AIRBRUSH = 2505,
1668     HOS_BUTTON_TOOL_FINGER = 2506,
1669     HOS_BUTTON_TOOL_MOUSE = 2507,
1670     HOS_BUTTON_TOOL_LENS = 2508,
1671     HOS_BUTTON_STYLUS = 2509,
1672     HOS_BUTTON_STYLUS2 = 2510,
1673     HOS_BUTTON_STYLUS3 = 2511,
1674     HOS_BUTTON_TOOL_DOUBLETAP = 2512,
1675     HOS_BUTTON_TOOL_TRIPLETAP = 2513,
1676     HOS_BUTTON_TOOL_QUADTAP = 2514,
1677     HOS_BUTTON_TOOL_QUINTTAP = 2515,
1678 };
1679 } // namespace OHOS
1680 #endif // HOS_KEY_EVENT_H