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 1294 HOS_KEY_CHANNEL = 3001, 1295 HOS_KEY_BTN_0 = 3100, 1296 HOS_KEY_BTN_1 = 3101, 1297 HOS_KEY_BTN_2 = 3102, 1298 HOS_KEY_BTN_3 = 3103, 1299 HOS_KEY_BTN_4 = 3104, 1300 HOS_KEY_BTN_5 = 3105, 1301 HOS_KEY_BTN_6 = 3106, 1302 HOS_KEY_BTN_7 = 3107, 1303 HOS_KEY_BTN_8 = 3108, 1304 HOS_KEY_BTN_9 = 3109, 1305 1306 HOS_KEY_BRL_DOT1 = 3201, 1307 HOS_KEY_BRL_DOT2 = 3202, 1308 HOS_KEY_BRL_DOT3 = 3203, 1309 HOS_KEY_BRL_DOT4 = 3204, 1310 HOS_KEY_BRL_DOT5 = 3205, 1311 HOS_KEY_BRL_DOT6 = 3206, 1312 HOS_KEY_BRL_DOT7 = 3207, 1313 HOS_KEY_BRL_DOT8 = 3208, 1314 HOS_KEY_BRL_DOT9 = 3209, 1315 HOS_KEY_BRL_DOT10 = 3210, 1316 1317 /** 1318 * Left Knob roll-up 1319 * <p>In contrast to {@link #KEY_LEFT_KNOB_ROLL_DOWN}, it means rolling the left knob upwards. The knob function 1320 * is scenario-specific, for example, increasing the volume or air conditioner temperature. 1321 * 1322 * @since 1 1323 */ 1324 HOS_KEY_LEFT_KNOB_ROLL_UP = 10001, 1325 1326 /** 1327 * Left Knob roll-down 1328 * <p>In contrast to {@link #KEY_LEFT_KNOB_ROLL_UP}, it means rolling the left knob downwards. The knob function 1329 * is scenario-specific, for example, reducing the volume or air conditioner temperature. 1330 * 1331 * @since 1 1332 */ 1333 HOS_KEY_LEFT_KNOB_ROLL_DOWN = 10002, 1334 1335 /** 1336 * Left Knob 1337 * <p>Pressing the knob will activate its adjustment function. 1338 * 1339 * @since 1 1340 */ 1341 HOS_KEY_LEFT_KNOB = 10003, 1342 1343 /** 1344 * Right Knob roll-up 1345 * <p>In contrast to {@link #KEY_RIGHT_KNOB_ROLL_DOWN}, it means rolling the right knob upwards. The knob 1346 * function is scenario-specific, for example, increasing the volume or air conditioner temperature. 1347 * 1348 * @since 1 1349 */ 1350 HOS_KEY_RIGHT_KNOB_ROLL_UP = 10004, 1351 1352 /** 1353 * Right Knob roll-down 1354 * <p>In contrast to {@link #KEY_RIGHT_KNOB_ROLL_UP}, it means rolling the right knob downwards. The knob 1355 * function is scenario-specific, for example, reducing the volume or air conditioner temperature. 1356 * 1357 * @since 1 1358 */ 1359 HOS_KEY_RIGHT_KNOB_ROLL_DOWN = 10005, 1360 1361 /** 1362 * Right Knob 1363 * <p>Pressing the knob will activate its adjustment function. 1364 * 1365 * @since 1 1366 */ 1367 HOS_KEY_RIGHT_KNOB = 10006, 1368 1369 /** 1370 * Audio Source Switch button 1371 * <p>Pressing this button will enable the audio source. Depending on the actual scenario, it may also 1372 * indicate that the Bluetooth call control button is pressed. 1373 * 1374 * @since 1 1375 */ 1376 HOS_KEY_VOICE_SOURCE_SWITCH = 10007, 1377 1378 /** 1379 * Menu key 1380 * <p>Pressing this key will display the launcher page. 1381 * 1382 * @since 1 1383 */ 1384 HOS_KEY_LAUNCHER_MENU = 10008, 1385 1386 /** 1387 * Keycode constant: max keycode 1388 * <p> If a new keycode added to {@code KeyEvent} is greater than the maximum keycode, update 1389 * the maximum keycode accordingly. 1390 * 1391 * @since 1 1392 */ 1393 HOS_NOW_MAX_KEY = HOS_KEY_LAUNCHER_MENU 1394 }; 1395 1396 enum MouseEnum { 1397 /** 1398 * Indicates that the left button on the mouse is pressed. 1399 * 1400 * @since 1 1401 */ 1402 HOS_LEFT_BUTTON = 1 << 0, 1403 1404 /** 1405 * Indicates that the right button on the mouse is pressed. 1406 * 1407 * @since 1 1408 */ 1409 HOS_RIGHT_BUTTON = 1 << 1, 1410 1411 /** 1412 * Indicates that the middle button on the mouse is pressed. 1413 * 1414 * @since 1 1415 */ 1416 HOS_MIDDLE_BUTTON = 1 << 2, 1417 1418 /** 1419 * Indicates that the back button on the mouse is pressed. 1420 * 1421 * @since 1 1422 */ 1423 HOS_BACK_BUTTON = 1 << 3, 1424 1425 /** 1426 * Indicates that the forward button on the mouse is pressed. 1427 * 1428 * @since 1 1429 */ 1430 HOS_FORWARD_BUTTON = 1 << 4, 1431 1432 HOS_SIDE_BUTTON = 1 << 5, 1433 HOS_EXTRA_BUTTON = 1 << 6, 1434 HOS_TASK_BUTTON = 1 << 7, 1435 }; 1436 1437 enum JoystickEnum { 1438 /** 1439 * Key code of joystick: 1440 * 1441 * @since 1 1442 */ 1443 HOS_KEY_BUTTON_TRIGGER = 2401, 1444 1445 /** 1446 * Key code of joystick: 1447 * 1448 * @since 1 1449 */ 1450 HOS_KEY_BUTTON_THUMB = 2402, 1451 1452 /** 1453 * Key code of joystick: 1454 * 1455 * @since 1 1456 */ 1457 HOS_KEY_BUTTON_THUMB2 = 2403, 1458 1459 /** 1460 * Key code of joystick: 1461 * 1462 * @since 1 1463 */ 1464 HOS_KEY_BUTTON_TOP = 2404, 1465 1466 /** 1467 * Key code of joystick: 1468 * 1469 * @since 1 1470 */ 1471 HOS_KEY_BUTTON_TOP2 = 2405, 1472 1473 /** 1474 * Key code of joystick: 1475 * 1476 * @since 1 1477 */ 1478 HOS_KEY_BUTTON_PINKIE = 2406, 1479 1480 /** 1481 * Key code of joystick: 1482 * 1483 * @since 1 1484 */ 1485 HOS_KEY_BUTTON_BASE1 = 2407, 1486 1487 /** 1488 * Key code of joystick: 1489 * 1490 * @since 1 1491 */ 1492 HOS_KEY_BUTTON_BASE2 = 2408, 1493 1494 /** 1495 * Key code of joystick: 1496 * 1497 * @since 1 1498 */ 1499 HOS_KEY_BUTTON_BASE3 = 2409, 1500 1501 /** 1502 * Key code of joystick: 1503 * 1504 * @since 1 1505 */ 1506 HOS_KEY_BUTTON_BASE4 = 2410, 1507 1508 /** 1509 * Key code of joystick: 1510 * 1511 * @since 1 1512 */ 1513 HOS_KEY_BUTTON_BASE5 = 2411, 1514 1515 /** 1516 * Key code of joystick: 1517 * 1518 * @since 1 1519 */ 1520 HOS_KEY_BUTTON_BASE6 = 2412, 1521 1522 /** 1523 * Key code of joystick: 1524 * 1525 * @since 1 1526 */ 1527 HOS_KEY_BUTTON_BASE7 = 2413, 1528 1529 /** 1530 * Key code of joystick: 1531 * 1532 * @since 1 1533 */ 1534 HOS_KEY_BUTTON_BASE8 = 2414, 1535 1536 /** 1537 * Key code of joystick: 1538 * 1539 * @since 1 1540 */ 1541 HOS_KEY_BUTTON_BASE9 = 2415, 1542 1543 /** 1544 * Key code of joystick: 1545 * 1546 * @since 1 1547 */ 1548 HOS_KEY_BUTTON_DEAD = 2416, 1549 }; 1550 1551 enum HandleEnum { 1552 /** 1553 * Key code of handle: 1554 * 1555 * @since 1 1556 */ 1557 HOS_KEY_BUTTON_A = 2301, 1558 1559 /** 1560 * Key code of handle: 1561 * 1562 * @since 1 1563 */ 1564 HOS_KEY_BUTTON_B = 2302, 1565 1566 /** 1567 * Key code of handle: 1568 * 1569 * @since 1 1570 */ 1571 HOS_KEY_BUTTON_C = 2303, 1572 1573 /** 1574 * Key code of handle: 1575 * 1576 * @since 1 1577 */ 1578 HOS_KEY_BUTTON_X = 2304, 1579 1580 /** 1581 * Key code of handle: 1582 * 1583 * @since 1 1584 */ 1585 HOS_KEY_BUTTON_Y = 2305, 1586 1587 /** 1588 * Key code of handle: 1589 * 1590 * @since 1 1591 */ 1592 HOS_KEY_BUTTON_Z = 2306, 1593 1594 /** 1595 * Key code of handle: 1596 * 1597 * @since 1 1598 */ 1599 HOS_KEY_BUTTON_L1 = 2307, 1600 1601 /** 1602 * Key code of handle: 1603 * 1604 * @since 1 1605 */ 1606 HOS_KEY_BUTTON_R1 = 2308, 1607 1608 /** 1609 * Key code of handle: 1610 * 1611 * @since 1 1612 */ 1613 HOS_KEY_BUTTON_L2 = 2309, 1614 1615 /** 1616 * Key code of handle: 1617 * 1618 * @since 1 1619 */ 1620 HOS_KEY_BUTTON_R2 = 2310, 1621 1622 /** 1623 * Key code of handle: 1624 * 1625 * @since 1 1626 */ 1627 HOS_KEY_BUTTON_SELECT = 2311, 1628 1629 /** 1630 * Key code of handle: 1631 * 1632 * @since 1 1633 */ 1634 HOS_KEY_BUTTON_START = 2312, 1635 1636 /** 1637 * Key code of handle: 1638 * 1639 * @since 1 1640 */ 1641 HOS_KEY_BUTTON_MODE = 2313, 1642 1643 /** 1644 * Key code of handle: 1645 * 1646 * @since 1 1647 */ 1648 HOS_KEY_BUTTON_THUMBL = 2314, 1649 1650 /** 1651 * Key code of handle: 1652 * 1653 * @since 1 1654 */ 1655 HOS_KEY_BUTTON_THUMBR = 2315, 1656 }; 1657 1658 enum TouchEnum { 1659 /** 1660 * Key code of touch: 1661 * 1662 * @since 1 1663 */ 1664 HOS_BUTTON_TOUCH = 2500, 1665 1666 HOS_BUTTON_TOOL_PEN = 2501, 1667 HOS_BUTTON_TOOL_RUBBER = 2502, 1668 HOS_BUTTON_TOOL_BRUSH = 2503, 1669 HOS_BUTTON_TOOL_PENCIL = 2504, 1670 HOS_BUTTON_TOOL_AIRBRUSH = 2505, 1671 HOS_BUTTON_TOOL_FINGER = 2506, 1672 HOS_BUTTON_TOOL_MOUSE = 2507, 1673 HOS_BUTTON_TOOL_LENS = 2508, 1674 HOS_BUTTON_STYLUS = 2509, 1675 HOS_BUTTON_STYLUS2 = 2510, 1676 HOS_BUTTON_STYLUS3 = 2511, 1677 HOS_BUTTON_TOOL_DOUBLETAP = 2512, 1678 HOS_BUTTON_TOOL_TRIPLETAP = 2513, 1679 HOS_BUTTON_TOOL_QUADTAP = 2514, 1680 HOS_BUTTON_TOOL_QUINTTAP = 2515, 1681 }; 1682 } // namespace OHOS 1683 #endif // HOS_KEY_EVENT_H