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