Back to Qmk Firmware

Basic Keycodes

docs/keycodes_basic.md

4.013.3 KB
Original Source

Basic Keycodes

The basic set of keycodes are based on the HID Keyboard/Keypad Usage Page (0x07) with the exception of KC_NO, KC_TRNS and keycodes in the 0xA5-DF range. See below for more details.

Letters and Numbers

KeyDescription
KC_Aa and A
KC_Bb and B
KC_Cc and C
KC_Dd and D
KC_Ee and E
KC_Ff and F
KC_Gg and G
KC_Hh and H
KC_Ii and I
KC_Jj and J
KC_Kk and K
KC_Ll and L
KC_Mm and M
KC_Nn and N
KC_Oo and O
KC_Pp and P
KC_Qq and Q
KC_Rr and R
KC_Ss and S
KC_Tt and T
KC_Uu and U
KC_Vv and V
KC_Ww and W
KC_Xx and X
KC_Yy and Y
KC_Zz and Z
KC_11 and !
KC_22 and @
KC_33 and #
KC_44 and $
KC_55 and %
KC_66 and ^
KC_77 and &
KC_88 and *
KC_99 and (
KC_00 and )

F Keys

KeyDescription
KC_F1F1
KC_F2F2
KC_F3F3
KC_F4F4
KC_F5F5
KC_F6F6
KC_F7F7
KC_F8F8
KC_F9F9
KC_F10F10
KC_F11F11
KC_F12F12
KC_F13F13
KC_F14F14
KC_F15F15
KC_F16F16
KC_F17F17
KC_F18F18
KC_F19F19
KC_F20F20
KC_F21F21
KC_F22F22
KC_F23F23
KC_F24F24

Punctuation

KeyAliasesDescription
KC_ENTERKC_ENTReturn (Enter)
KC_ESCAPEKC_ESCEscape
KC_BACKSPACEKC_BSPCDelete (Backspace)
KC_TABTab
KC_SPACEKC_SPCSpacebar
KC_MINUSKC_MINS- and _
KC_EQUALKC_EQL= and +
KC_LEFT_BRACKETKC_LBRC[ and {
KC_RIGHT_BRACKETKC_RBRC] and }
KC_BACKSLASHKC_BSLS\ and |
KC_NONUS_HASHKC_NUHSNon-US # and ~
KC_SEMICOLONKC_SCLN; and :
KC_QUOTEKC_QUOT' and "
KC_GRAVEKC_GRV<code>`</code> and ~
KC_COMMAKC_COMM, and <
KC_DOT. and >
KC_SLASHKC_SLSH/ and ?
KC_NONUS_BACKSLASHKC_NUBSNon-US \ and |

Lock Keys

KeyAliasesDescription
KC_CAPS_LOCKKC_CAPSCaps Lock
KC_SCROLL_LOCKKC_SCRL, KC_BRMDScroll Lock, Brightness Down (macOS)
KC_NUM_LOCKKC_NUMKeypad Num Lock and Clear
KC_LOCKING_CAPS_LOCKKC_LCAPLocking Caps Lock
KC_LOCKING_NUM_LOCKKC_LNUMLocking Num Lock
KC_LOCKING_SCROLL_LOCKKC_LSCRLocking Scroll Lock

Modifiers

KeyAliasesDescription
KC_LEFT_CTRLKC_LCTLLeft Control
KC_LEFT_SHIFTKC_LSFTLeft Shift
KC_LEFT_ALTKC_LALT, KC_LOPTLeft Alt (Option)
KC_LEFT_GUIKC_LGUI, KC_LCMD, KC_LWINLeft GUI (Windows/Command/Super key)
KC_RIGHT_CTRLKC_RCTLRight Control
KC_RIGHT_SHIFTKC_RSFTRight Shift
KC_RIGHT_ALTKC_RALT, KC_ROPT, KC_ALGRRight Alt (Option/AltGr)
KC_RIGHT_GUIKC_RGUI, KC_RCMD, KC_RWINRight GUI (Windows/Command/Super key)

International

KeyAliasesDescription
KC_INTERNATIONAL_1KC_INT1JIS \ and _
KC_INTERNATIONAL_2KC_INT2JIS Katakana/Hiragana
KC_INTERNATIONAL_3KC_INT3JIS ¥ and |
KC_INTERNATIONAL_4KC_INT4JIS Henkan
KC_INTERNATIONAL_5KC_INT5JIS Muhenkan
KC_INTERNATIONAL_6KC_INT6JIS Numpad ,
KC_INTERNATIONAL_7KC_INT7International 7
KC_INTERNATIONAL_8KC_INT8International 8
KC_INTERNATIONAL_9KC_INT9International 9
KC_LANGUAGE_1KC_LNG1Hangul/English
KC_LANGUAGE_2KC_LNG2Hanja
KC_LANGUAGE_3KC_LNG3JIS Katakana
KC_LANGUAGE_4KC_LNG4JIS Hiragana
KC_LANGUAGE_5KC_LNG5JIS Zenkaku/Hankaku
KC_LANGUAGE_6KC_LNG6Language 6
KC_LANGUAGE_7KC_LNG7Language 7
KC_LANGUAGE_8KC_LNG8Language 8
KC_LANGUAGE_9KC_LNG9Language 9

Commands

KeyAliasesDescription
KC_PRINT_SCREENKC_PSCRPrint Screen
KC_PAUSEKC_PAUS, KC_BRK, KC_BRMUPause, Brightness Up (macOS)
KC_INSERTKC_INSInsert
KC_HOMEHome
KC_PAGE_UPKC_PGUPPage Up
KC_DELETEKC_DELForward Delete
KC_ENDEnd
KC_PAGE_DOWNKC_PGDNPage Down
KC_RIGHTKC_RGHTRight Arrow
KC_LEFTLeft Arrow
KC_DOWNDown Arrow
KC_UPUp Arrow
KC_APPLICATIONKC_APPApplication (Windows Context Menu Key)
KC_KB_POWERSystem Power
KC_EXECUTEKC_EXECExecute
KC_HELPHelp
KC_MENUMenu
KC_SELECTKC_SLCTSelect
KC_STOPStop
KC_AGAINKC_AGINAgain
KC_UNDOUndo
KC_CUTCut
KC_COPYCopy
KC_PASTEKC_PSTEPaste
KC_FINDFind
KC_KB_MUTEMute
KC_KB_VOLUME_UPVolume Up
KC_KB_VOLUME_DOWNVolume Down
KC_ALTERNATE_ERASEKC_ERASAlternate Erase
KC_SYSTEM_REQUESTKC_SYRQSysReq/Attention
KC_CANCELKC_CNCLCancel
KC_CLEARKC_CLRClear
KC_PRIORKC_PRIRPrior
KC_RETURNKC_RETNReturn
KC_SEPARATORKC_SEPRSeparator
KC_OUTOut
KC_OPEROper
KC_CLEAR_AGAINKC_CLAGClear/Again
KC_CRSELKC_CRSLCrSel/Props
KC_EXSELKC_EXSLExSel

Media Keys

These keycodes are not part of the Keyboard/Keypad usage page. The SYSTEM_ keycodes are found in the Generic Desktop page, and the rest are located in the Consumer page.

::: tip Some of these keycodes may behave differently depending on the OS. For example, on macOS, the keycodes KC_MEDIA_FAST_FORWARD, KC_MEDIA_REWIND, KC_MEDIA_NEXT_TRACK and KC_MEDIA_PREV_TRACK skip within the current track when held, but skip the entire track when tapped. :::

KeyAliasesDescription
KC_SYSTEM_POWERKC_PWRSystem Power Down
KC_SYSTEM_SLEEPKC_SLEPSystem Sleep
KC_SYSTEM_WAKEKC_WAKESystem Wake
KC_AUDIO_MUTEKC_MUTEMute
KC_AUDIO_VOL_UPKC_VOLUVolume Up
KC_AUDIO_VOL_DOWNKC_VOLDVolume Down
KC_MEDIA_NEXT_TRACKKC_MNXTNext Track
KC_MEDIA_PREV_TRACKKC_MPRVPrevious Track
KC_MEDIA_STOPKC_MSTPStop Track
KC_MEDIA_PLAY_PAUSEKC_MPLYPlay/Pause Track
KC_MEDIA_SELECTKC_MSELLaunch Media Player
KC_MEDIA_EJECTKC_EJCTEject
KC_MAILLaunch Mail
KC_CALCULATORKC_CALCLaunch Calculator
KC_MY_COMPUTERKC_MYCMLaunch My Computer
KC_WWW_SEARCHKC_WSCHBrowser Search
KC_WWW_HOMEKC_WHOMBrowser Home
KC_WWW_BACKKC_WBAKBrowser Back
KC_WWW_FORWARDKC_WFWDBrowser Forward
KC_WWW_STOPKC_WSTPBrowser Stop
KC_WWW_REFRESHKC_WREFBrowser Refresh
KC_WWW_FAVORITESKC_WFAVBrowser Favorites
KC_MEDIA_FAST_FORWARDKC_MFFDFast Forward
KC_MEDIA_REWINDKC_MRWDRewind
KC_BRIGHTNESS_UPKC_BRIUBrightness Up
KC_BRIGHTNESS_DOWNKC_BRIDBrightness Down
KC_CONTROL_PANELKC_CPNLOpen Control Panel
KC_ASSISTANTKC_ASSTLaunch Assistant
KC_MISSION_CONTROLKC_MCTLOpen Mission Control
KC_LAUNCHPADKC_LPADOpen Launchpad

Number Pad

KeyAliasesDescription
KC_KP_SLASHKC_PSLSKeypad /
KC_KP_ASTERISKKC_PASTKeypad *
KC_KP_MINUSKC_PMNSKeypad -
KC_KP_PLUSKC_PPLSKeypad +
KC_KP_ENTERKC_PENTKeypad Enter
KC_KP_1KC_P1Keypad 1 and End
KC_KP_2KC_P2Keypad 2 and Down Arrow
KC_KP_3KC_P3Keypad 3 and Page Down
KC_KP_4KC_P4Keypad 4 and Left Arrow
KC_KP_5KC_P5Keypad 5
KC_KP_6KC_P6Keypad 6 and Right Arrow
KC_KP_7KC_P7Keypad 7 and Home
KC_KP_8KC_P8Keypad 8 and Up Arrow
KC_KP_9KC_P9Keypad 9 and Page Up
KC_KP_0KC_P0Keypad 0 and Insert
KC_KP_DOTKC_PDOTKeypad . and Delete
KC_KP_EQUALKC_PEQLKeypad =
KC_KP_COMMAKC_PCMMKeypad ,
KC_KP_EQUAL_AS400Keypad = on AS/400 keyboards

Special Keys

In addition to these, keycodes in the range of 0xA5-DF are reserved for internal use.

KeyAliasesDescription
KC_NOXXXXXXXIgnore this key (NOOP)
KC_TRANSPARENTKC_TRNS, _______Use the next lowest non-transparent key