1# @ohos.multimodalInput.keyCode (Keycode) 2 3The **keyCode** module provides keycode values for key devices, such as the keyboard, power key, camera key, and the like. 4 5> **NOTE** 6> 7> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. 8 9## Modules to Import 10 11```js 12import {KeyCode} from '@ohos.multimodalInput.keyCode'; 13``` 14 15## KeyCode 16 17Keycode value. 18 19**System capability**: SystemCapability.MultimodalInput.Input.Core 20 21| Name | Value | Description | 22| -------------------------------- | ------ | --------------------------- | 23| KEYCODE_FN | 0 | Function (Fn) key | 24| KEYCODE_UNKNOWN | -1 | Unknown key | 25| KEYCODE_HOME | 1 | Function (Home) key | 26| KEYCODE_BACK | 2 | Back key | 27| KEYCODE_MEDIA_PLAY_PAUSE | 10 | Play/Pause key | 28| KEYCODE_MEDIA_STOP | 11 | Stop key | 29| KEYCODE_MEDIA_NEXT | 12 | Next key | 30| KEYCODE_MEDIA_PREVIOUS | 13 | Previous key | 31| KEYCODE_MEDIA_REWIND | 14 | Rewind key | 32| KEYCODE_MEDIA_FAST_FORWARD | 15 | Fast Forward key | 33| KEYCODE_VOLUME_UP | 16 | Volume Up key | 34| KEYCODE_VOLUME_DOWN | 17 | Volume Down key | 35| KEYCODE_POWER | 18 | Power key | 36| KEYCODE_CAMERA | 19 | Camera key | 37| KEYCODE_VOLUME_MUTE | 22 | Speaker Mute key | 38| KEYCODE_MUTE | 23 | Mute key | 39| KEYCODE_BRIGHTNESS_UP | 40 | Brightness Up key | 40| KEYCODE_BRIGHTNESS_DOWN | 41 | Brightness Down key | 41| KEYCODE_0 | 2000 | Key 0 | 42| KEYCODE_1 | 2001 | Key 1 | 43| KEYCODE_2 | 2002 | Key 2 | 44| KEYCODE_3 | 2003 | Key 3 | 45| KEYCODE_4 | 2004 | Key 4 | 46| KEYCODE_5 | 2005 | Key 5 | 47| KEYCODE_6 | 2006 | Key 6 | 48| KEYCODE_7 | 2007 | Key 7 | 49| KEYCODE_8 | 2008 | Key 8 | 50| KEYCODE_9 | 2009 | Key 9 | 51| KEYCODE_STAR | 2010 | Key * | 52| KEYCODE_POUND | 2011 | Key # | 53| KEYCODE_DPAD_UP | 2012 | Up key on D-pad | 54| KEYCODE_DPAD_DOWN | 2013 | Down key on D-pad | 55| KEYCODE_DPAD_LEFT | 2014 | Left key on D-pad | 56| KEYCODE_DPAD_RIGHT | 2015 | Right key on D-pad | 57| KEYCODE_DPAD_CENTER | 2016 | Center key on D-pad | 58| KEYCODE_A | 2017 | Key A | 59| KEYCODE_B | 2018 | Key B | 60| KEYCODE_C | 2019 | Key C | 61| KEYCODE_D | 2020 | Key D | 62| KEYCODE_E | 2021 | Key E | 63| KEYCODE_F | 2022 | Key F | 64| KEYCODE_G | 2023 | Key G | 65| KEYCODE_H | 2024 | Key H | 66| KEYCODE_I | 2025 | Key I | 67| KEYCODE_J | 2026 | Key J | 68| KEYCODE_K | 2027 | Key K | 69| KEYCODE_L | 2028 | Key L | 70| KEYCODE_M | 2029 | Key M | 71| KEYCODE_N | 2030 | Key N | 72| KEYCODE_O | 2031 | Key O | 73| KEYCODE_P | 2032 | Key P | 74| KEYCODE_Q | 2033 | Key Q | 75| KEYCODE_R | 2034 | Key R | 76| KEYCODE_S | 2035 | Key S | 77| KEYCODE_T | 2036 | Key T | 78| KEYCODE_U | 2037 | Key U | 79| KEYCODE_V | 2038 | Key V | 80| KEYCODE_W | 2039 | Key W | 81| KEYCODE_X | 2040 | Key X | 82| KEYCODE_Y | 2041 | Key Y | 83| KEYCODE_Z | 2042 | Key Z | 84| KEYCODE_COMMA | 2043 | Key , | 85| KEYCODE_PERIOD | 2044 | Key . | 86| KEYCODE_ALT_LEFT | 2045 | Left Alt key | 87| KEYCODE_ALT_RIGHT | 2046 | Right Alt key | 88| KEYCODE_SHIFT_LEFT | 2047 | Left Shift key | 89| KEYCODE_SHIFT_RIGHT | 2048 | Right Shift key | 90| KEYCODE_TAB | 2049 | Tab key | 91| KEYCODE_SPACE | 2050 | Space key | 92| KEYCODE_SYM | 2051 | Symbol key | 93| KEYCODE_EXPLORER | 2052 | Explorer key, used to start the explorer application | 94| KEYCODE_ENVELOPE | 2053 | Email key, used to start the email application | 95| KEYCODE_ENTER | 2054 | Enter key | 96| KEYCODE_DEL | 2055 | Delete key | 97| KEYCODE_GRAVE | 2056 | Key ` | 98| KEYCODE_MINUS | 2057 | Key - | 99| KEYCODE_EQUALS | 2058 | Key = | 100| KEYCODE_LEFT_BRACKET | 2059 | Key [ | 101| KEYCODE_RIGHT_BRACKET | 2060 | Key ] | 102| KEYCODE_BACKSLASH | 2061 | Key \\ | 103| KEYCODE_SEMICOLON | 2062 | Key ; | 104| KEYCODE_APOSTROPHE | 2063 | Key ' | 105| KEYCODE_SLASH | 2064 | Key / | 106| KEYCODE_AT | 2065 | Key @ | 107| KEYCODE_PLUS | 2066 | Key + | 108| KEYCODE_MENU | 2067 | Menu key | 109| KEYCODE_PAGE_UP | 2068 | Page Up key | 110| KEYCODE_PAGE_DOWN | 2069 | Page Down key | 111| KEYCODE_ESCAPE | 2070 | ESC key | 112| KEYCODE_FORWARD_DEL | 2071 | Delete key | 113| KEYCODE_CTRL_LEFT | 2072 | Left Ctrl key | 114| KEYCODE_CTRL_RIGHT | 2073 | Right Ctrl key | 115| KEYCODE_CAPS_LOCK | 2074 | Caps Lock key | 116| KEYCODE_SCROLL_LOCK | 2075 | Scroll Lock key | 117| KEYCODE_META_LEFT | 2076 | Left Meta key | 118| KEYCODE_META_RIGHT | 2077 | Right Meta key | 119| KEYCODE_FUNCTION | 2078 | Function key | 120| KEYCODE_SYSRQ | 2079 | System Request/Print Screen key | 121| KEYCODE_BREAK | 2080 | Break/Pause key | 122| KEYCODE_MOVE_HOME | 2081 | Move to Home key | 123| KEYCODE_MOVE_END | 2082 | Move to End key | 124| KEYCODE_INSERT | 2083 | Insert key | 125| KEYCODE_FORWARD | 2084 | Forward key | 126| KEYCODE_MEDIA_PLAY | 2085 | Play key | 127| KEYCODE_MEDIA_PAUSE | 2086 | Pause key | 128| KEYCODE_MEDIA_CLOSE | 2087 | Close key | 129| KEYCODE_MEDIA_EJECT | 2088 | Eject key | 130| KEYCODE_MEDIA_RECORD | 2089 | Record key | 131| KEYCODE_F1 | 2090 | F1 key | 132| KEYCODE_F2 | 2091 | F2 key | 133| KEYCODE_F3 | 2092 | F3 key | 134| KEYCODE_F4 | 2093 | F4 key | 135| KEYCODE_F5 | 2094 | F5 key | 136| KEYCODE_F6 | 2095 | F6 key | 137| KEYCODE_F7 | 2096 | F7 key | 138| KEYCODE_F8 | 2097 | F8 key | 139| KEYCODE_F9 | 2098 | F9 key | 140| KEYCODE_F10 | 2099 | F10 key | 141| KEYCODE_F11 | 2100 | F11 key | 142| KEYCODE_F12 | 2101 | F12 key | 143| KEYCODE_NUM_LOCK | 2102 | Number Lock key | 144| KEYCODE_NUMPAD_0 | 2103 | Key 0 on numeric keypad | 145| KEYCODE_NUMPAD_1 | 2104 | Key 1 on numeric keypad | 146| KEYCODE_NUMPAD_2 | 2105 | Key 2 on numeric keypad | 147| KEYCODE_NUMPAD_3 | 2106 | Key 3 on numeric keypad | 148| KEYCODE_NUMPAD_4 | 2107 | Key 4 on numeric keypad | 149| KEYCODE_NUMPAD_5 | 2108 | Key 5 on numeric keypad | 150| KEYCODE_NUMPAD_6 | 2109 | Key 6 on numeric keypad | 151| KEYCODE_NUMPAD_7 | 2110 | Key 7 on numeric keypad | 152| KEYCODE_NUMPAD_8 | 2111 | Key 8 on numeric keypad | 153| KEYCODE_NUMPAD_9 | 2112 | Key 9 on numeric keypad | 154| KEYCODE_NUMPAD_DIVIDE | 2113 | Key / on numeric keypad | 155| KEYCODE_NUMPAD_MULTIPLY | 2114 | Key * on numeric keypad | 156| KEYCODE_NUMPAD_SUBTRACT | 2115 | Key - on numeric keypad | 157| KEYCODE_NUMPAD_ADD | 2116 | Key + on numeric keypad | 158| KEYCODE_NUMPAD_DOT | 2117 | Key . on numeric keypad | 159| KEYCODE_NUMPAD_COMMA | 2118 | Key , on numeric keypad | 160| KEYCODE_NUMPAD_ENTER | 2119 | Enter key on numeric keypad | 161| KEYCODE_NUMPAD_EQUALS | 2120 | Key = on numeric keypad | 162| KEYCODE_NUMPAD_LEFT_PAREN | 2121 | Key ( on numeric keypad | 163| KEYCODE_NUMPAD_RIGHT_PAREN | 2122 | Key ) on numeric keypad | 164| KEYCODE_VIRTUAL_MULTITASK | 2210 | Multi-task key | 165| KEYCODE_SLEEP | 2600 | Sleep key | 166| KEYCODE_ZENKAKU_HANKAKU | 2601 | Zenkaku/Hankaku key | 167| KEYCODE_102ND | 2602 | 102nd key | 168| KEYCODE_RO | 2603 | Ro key | 169| KEYCODE_KATAKANA | 2604 | Katakana key | 170| KEYCODE_HIRAGANA | 2605 | Hiragana key | 171| KEYCODE_HENKAN | 2606 | Henkan key | 172| KEYCODE_KATAKANA_HIRAGANA | 2607 | Katakana/Hiragana key | 173| KEYCODE_MUHENKAN | 2608 | Muhenkan key | 174| KEYCODE_LINEFEED | 2609 | Linefeed key | 175| KEYCODE_MACRO | 2610 | Macro key | 176| KEYCODE_NUMPAD_PLUSMINUS | 2611 | Plus/Minus key on the numeric keypad | 177| KEYCODE_SCALE | 2612 | Scale key | 178| KEYCODE_HANGUEL | 2613 | Hanguel key | 179| KEYCODE_HANJA | 2614 | Hanja key | 180| KEYCODE_YEN | 2615 | Yen key | 181| KEYCODE_STOP | 2616 | Stop key | 182| KEYCODE_AGAIN | 2617 | Again key | 183| KEYCODE_PROPS | 2618 | Props key | 184| KEYCODE_UNDO | 2619 | Undo key | 185| KEYCODE_COPY | 2620 | Copy key | 186| KEYCODE_OPEN | 2621 | Open key | 187| KEYCODE_PASTE | 2622 | Paste key | 188| KEYCODE_FIND | 2623 | Find key | 189| KEYCODE_CUT | 2624 | Cut key | 190| KEYCODE_HELP | 2625 | Help key | 191| KEYCODE_CALC | 2626 | Calc key, used to start the calculator application | 192| KEYCODE_FILE | 2627 | File key | 193| KEYCODE_BOOKMARKS | 2628 | Bookmarks key | 194| KEYCODE_NEXT | 2629 | Next key | 195| KEYCODE_PLAYPAUSE | 2630 | Play/Pause key | 196| KEYCODE_PREVIOUS | 2631 | Previous key | 197| KEYCODE_STOPCD | 2632 | Stop CD key | 198| KEYCODE_CONFIG | 2634 | Config key | 199| KEYCODE_REFRESH | 2635 | Refresh key | 200| KEYCODE_EXIT | 2636 | Exit key | 201| KEYCODE_EDIT | 2637 | Edit key | 202| KEYCODE_SCROLLUP | 2638 | Scroll Up key | 203| KEYCODE_SCROLLDOWN | 2639 | Scroll Down key | 204| KEYCODE_NEW | 2640 | New key | 205| KEYCODE_REDO | 2641 | Redo key | 206| KEYCODE_CLOSE | 2642 | Close key | 207| KEYCODE_PLAY | 2643 | Play key | 208| KEYCODE_BASSBOOST | 2644 | Bass Boost key | 209| KEYCODE_PRINT | 2645 | Print key | 210| KEYCODE_CHAT | 2646 | Chat key | 211| KEYCODE_FINANCE | 2647 | Finance key | 212| KEYCODE_CANCEL | 2648 | Cancel key | 213| KEYCODE_KBDILLUM_TOGGLE | 2649 | Keyboard Illumination Toggle key | 214| KEYCODE_KBDILLUM_DOWN | 2650 | Keyboard Illumination Up key | 215| KEYCODE_KBDILLUM_UP | 2651 | Keyboard Illumination Down key | 216| KEYCODE_SEND | 2652 | Send key | 217| KEYCODE_REPLY | 2653 | Reply key | 218| KEYCODE_FORWARDMAIL | 2654 | Forward Mail key | 219| KEYCODE_SAVE | 2655 | Save key | 220| KEYCODE_DOCUMENTS | 2656 | Documents key | 221| KEYCODE_VIDEO_NEXT | 2657 | Next Video key | 222| KEYCODE_VIDEO_PREV | 2658 | Previous Video key | 223| KEYCODE_BRIGHTNESS_CYCLE | 2659 | Brightness Cycle key | 224| KEYCODE_BRIGHTNESS_ZERO | 2660 | Brightness Zero key | 225| KEYCODE_DISPLAY_OFF | 2661 | Display Off Key | 226| KEYCODE_BTN_MISC | 2662 | Misc Button key | 227| KEYCODE_GOTO | 2663 | Goto key | 228| KEYCODE_INFO | 2664 | Info key | 229| KEYCODE_PROGRAM | 2665 | Program key | 230| KEYCODE_PVR | 2666 | PVR key | 231| KEYCODE_SUBTITLE | 2667 | Subtitle key | 232| KEYCODE_FULL_SCREEN | 2668 | Full Screen key | 233| KEYCODE_KEYBOARD | 2669 | Keyboard | 234| KEYCODE_ASPECT_RATIO | 2670 | Aspect Ratio key | 235| KEYCODE_PC | 2671 | Port Control key | 236| KEYCODE_TV | 2672 | TV key | 237| KEYCODE_TV2 | 2673 | TV key 2 | 238| KEYCODE_VCR | 2674 | VCR key | 239| KEYCODE_VCR2 | 2675 | VCR key 2 | 240| KEYCODE_SAT | 2676 | SAT key | 241| KEYCODE_CD | 2677 | CD key | 242| KEYCODE_TAPE | 2678 | Tape key | 243| KEYCODE_TUNER | 2679 | Tuner key | 244| KEYCODE_PLAYER | 2680 | Player key | 245| KEYCODE_DVD | 2681 | DVD key | 246| KEYCODE_AUDIO | 2682 | Audio key | 247| KEYCODE_VIDEO | 2683 | Video key | 248| KEYCODE_MEMO | 2684 | Memo key | 249| KEYCODE_CALENDAR | 2685 | Calendar key | 250| KEYCODE_RED | 2686 | Red indicator | 251| KEYCODE_GREEN | 2687 | Green indicator | 252| KEYCODE_YELLOW | 2688 | Yellow indicator | 253| KEYCODE_BLUE | 2689 | Blue indicator | 254| KEYCODE_CHANNELUP | 2690 | Channel Up key | 255| KEYCODE_CHANNELDOWN | 2691 | Channel Down key | 256| KEYCODE_LAST | 2692 | Last key | 257| KEYCODE_RESTART | 2693 | Restart key | 258| KEYCODE_SLOW | 2694 | Slow key | 259| KEYCODE_SHUFFLE | 2695 | Shuffle key | 260| KEYCODE_VIDEOPHONE | 2696 | Videophone key | 261| KEYCODE_GAMES | 2697 | Games key | 262| KEYCODE_ZOOMIN | 2698 | Zoom-in key | 263| KEYCODE_ZOOMOUT | 2699 | Zoom-out key | 264| KEYCODE_ZOOMRESET | 2700 | Zoom Reset key | 265| KEYCODE_WORDPROCESSOR | 2701 | Word Processor key | 266| KEYCODE_EDITOR | 2702 | Editor key | 267| KEYCODE_SPREADSHEET | 2703 | Spreadsheet key | 268| KEYCODE_GRAPHICSEDITOR | 2704 | Graphics Editor key | 269| KEYCODE_PRESENTATION | 2705 | Presentation key | 270| KEYCODE_DATABASE | 2706 | Database key | 271| KEYCODE_NEWS | 2707 | News key | 272| KEYCODE_VOICEMAIL | 2708 | Voicemail key | 273| KEYCODE_ADDRESSBOOK | 2709 | Addressbook key | 274| KEYCODE_MESSENGER | 2710 | Messenger key | 275| KEYCODE_BRIGHTNESS_TOGGLE | 2711 | Brightness Toggle key | 276| KEYCODE_SPELLCHECK | 2712 | Spell Check key | 277| KEYCODE_COFFEE | 2713 | Coffee key, used to launch screen lock or screen saver | 278| KEYCODE_MEDIA_REPEAT | 2714 | Media Repeat key | 279| KEYCODE_IMAGES | 2715 | Images key | 280| KEYCODE_BUTTONCONFIG | 2716 | Button Configuration key | 281| KEYCODE_TASKMANAGER | 2717 | Task Manager key | 282| KEYCODE_JOURNAL | 2718 | Log key | 283| KEYCODE_CONTROLPANEL | 2719 | Control Panel key | 284| KEYCODE_APPSELECT | 2720 | App Select key | 285| KEYCODE_SCREENSAVER | 2721 | Screen Saver key | 286| KEYCODE_ASSISTANT | 2722 | Assistant key | 287| KEYCODE_KBD_LAYOUT_NEXT | 2723 | Next Keyboard Layout key | 288| KEYCODE_BRIGHTNESS_MIN | 2724 | Min Brightness key | 289| KEYCODE_BRIGHTNESS_MAX | 2725 | Max Brightness key | 290| KEYCODE_KBDINPUTASSIST_PREV | 2726 | Assist_Previous key, used to view historical inputs. | 291| KEYCODE_KBDINPUTASSIST_NEXT | 2727 | Assist_Next key, used to view predictive inputs. | 292| KEYCODE_KBDINPUTASSIST_PREVGROUP | 2728 | Assist_Previous_Group key, used to switch to the previous input method in the input group. | 293| KEYCODE_KBDINPUTASSIST_NEXTGROUP | 2729 | Assist_Next_Group key, used to switch to the next input method in the input group. | 294| KEYCODE_KBDINPUTASSIST_ACCEPT | 2730 | Keyboard Input-assisted Accept key | 295| KEYCODE_KBDINPUTASSIST_CANCEL | 2731 | Keyboard Input-assisted Cancel key | 296| KEYCODE_FRONT | 2800 | Front key, used to launch the windshield defogger | 297| KEYCODE_SETUP | 2801 | Setup key | 298| KEYCODE_WAKEUP | 2802 | Wakeup key | 299| KEYCODE_SENDFILE | 2803 | Send File key | 300| KEYCODE_DELETEFILE | 2804 | Delete File key | 301| KEYCODE_XFER | 2805 | XFER key, used to start file transfer | 302| KEYCODE_PROG1 | 2806 | Program key 1 | 303| KEYCODE_PROG2 | 2807 | Program key 2 | 304| KEYCODE_MSDOS | 2808 | MS-DOS key | 305| KEYCODE_SCREENLOCK | 2809 | Screen Lock key | 306| KEYCODE_DIRECTION_ROTATE_DISPLAY | 2810 | Directional Rotation Display key | 307| KEYCODE_CYCLEWINDOWS | 2811 | Windows Cycle key | 308| KEYCODE_COMPUTER | 2812 | Keys | 309| KEYCODE_EJECTCLOSECD | 2813 | Eject CD key | 310| KEYCODE_ISO | 2814 | ISO key | 311| KEYCODE_MOVE | 2815 | Move key | 312| KEYCODE_F13 | 2816 | F13 key | 313| KEYCODE_F14 | 2817 | F14 key | 314| KEYCODE_F15 | 2818 | F15 key | 315| KEYCODE_F16 | 2819 | F16 key | 316| KEYCODE_F17 | 2820 | F17 key | 317| KEYCODE_F18 | 2821 | F18 key | 318| KEYCODE_F19 | 2822 | F19 key | 319| KEYCODE_F20 | 2823 | F20 key | 320| KEYCODE_F21 | 2824 | F21 key | 321| KEYCODE_F22 | 2825 | F22 key | 322| KEYCODE_F23 | 2826 | F23 key | 323| KEYCODE_F24 | 2827 | F24 key | 324| KEYCODE_PROG3 | 2828 | Program key 3 | 325| KEYCODE_PROG4 | 2829 | Program key 4 | 326| KEYCODE_DASHBOARD | 2830 | Dashboard | 327| KEYCODE_SUSPEND | 2831 | Suspend key | 328| KEYCODE_HP | 2832 | HP key | 329| KEYCODE_SOUND | 2833 | Sound key | 330| KEYCODE_QUESTION | 2834 | Question key | 331| KEYCODE_CONNECT | 2836 | Connect key | 332| KEYCODE_SPORT | 2837 | Sport key | 333| KEYCODE_SHOP | 2838 | Shop key | 334| KEYCODE_ALTERASE | 2839 | Alternate key | 335| KEYCODE_SWITCHVIDEOMODE | 2841 | Switch Video Mode key (monitor, LCD, and TV, etc.)| 336| KEYCODE_BATTERY | 2842 | Battery key | 337| KEYCODE_BLUETOOTH | 2843 | Bluetooth key | 338| KEYCODE_WLAN | 2844 | WLAN key | 339| KEYCODE_UWB | 2845 | Ultra-wideband key | 340| KEYCODE_WWAN_WIMAX | 2846 | WWAN WiMAX key | 341| KEYCODE_RFKILL | 2847 | RF Kill key | 342| KEYCODE_CHANNEL | 3001 | Channel key | 343| KEYCODE_BTN_0 | 3100 | Button 0 | 344| KEYCODE_BTN_1 | 3101 | Button 1 | 345| KEYCODE_BTN_2 | 3102 | Button 2 | 346| KEYCODE_BTN_3 | 3103 | Button 3 | 347| KEYCODE_BTN_4 | 3104 | Button 4 | 348| KEYCODE_BTN_5 | 3105 | Button 5 | 349| KEYCODE_BTN_6 | 3106 | Button 6 | 350| KEYCODE_BTN_7 | 3107 | Button 7 | 351| KEYCODE_BTN_8 | 3108 | Button 8 | 352| KEYCODE_BTN_9 | 3109 | Button 9 | 353