Event Keycodes

In order to see if the user pressed a key, you'll need to use the correct keycodes for it. In cave, you can do this by passing the event type (from cave.event) or by the key name as a string. See cave.Events for more details.

In this page you'll find every key name.

Mouse Events

Event Type Event Name as String Key
cave.event.MOUSE_LEFT "MOUSE_LEFT" Mouse Left
cave.event.MOUSE_MIDDLE "MOUSE_MIDDLE" Mouse Middle
cave.event.MOUSE_RIGHT "MOUSE_RIGHT" Mouse Right

Keyboard Events

Event Type Event Name as String Key
cave.event.KEY_0 "0" 0
cave.event.KEY_1 "1" 1
cave.event.KEY_2 "2" 2
cave.event.KEY_3 "3" 3
cave.event.KEY_4 "4" 4
cave.event.KEY_5 "5" 5
cave.event.KEY_6 "6" 6
cave.event.KEY_7 "7" 7
cave.event.KEY_8 "8" 8
cave.event.KEY_9 "9" 9
cave.event.KEY_A "A" A
cave.event.KEY_AC_BACK "AC_BACK" Ac Back
cave.event.KEY_AC_BOOKMARKS "AC_BOOKMARKS" Ac Bookmarks
cave.event.KEY_AC_FORWARD "AC_FORWARD" Ac Forward
cave.event.KEY_AC_HOME "AC_HOME" Ac Home
cave.event.KEY_AC_REFRESH "AC_REFRESH" Ac Refresh
cave.event.KEY_AC_SEARCH "AC_SEARCH" Ac Search
cave.event.KEY_AC_STOP "AC_STOP" Ac Stop
cave.event.KEY_AGAIN "AGAIN" Again
cave.event.KEY_ALTERASE "ALTERASE" Alterase
cave.event.KEY_AMPERSAND "AMPERSAND" Ampersand
cave.event.KEY_APPLICATION "APPLICATION" Application
cave.event.KEY_ASTERISK "ASTERISK" Asterisk
cave.event.KEY_AT "AT" At
cave.event.KEY_AUDIOMUTE "AUDIOMUTE" Audiomute
cave.event.KEY_AUDIONEXT "AUDIONEXT" Audionext
cave.event.KEY_AUDIOPLAY "AUDIOPLAY" Audioplay
cave.event.KEY_AUDIOPREV "AUDIOPREV" Audioprev
cave.event.KEY_AUDIOSTOP "AUDIOSTOP" Audiostop
cave.event.KEY_B "B" B
cave.event.KEY_BACKQUOTE "BACKQUOTE" Backquote
cave.event.KEY_BACKSLASH "BACKSLASH" Backslash
cave.event.KEY_BACKSPACE "BACKSPACE" Backspace
cave.event.KEY_BRIGHTNESSDOWN "BRIGHTNESSDOWN" Brightnessdown
cave.event.KEY_BRIGHTNESSUP "BRIGHTNESSUP" Brightnessup
cave.event.KEY_C "C" C
cave.event.KEY_CALCULATOR "CALCULATOR" Calculator
cave.event.KEY_CANCEL "CANCEL" Cancel
cave.event.KEY_CAPSLOCK "CAPSLOCK" Capslock
cave.event.KEY_CARET "CARET" Caret
cave.event.KEY_CLEAR "CLEAR" Clear
cave.event.KEY_CLEARAGAIN "CLEARAGAIN" Clearagain
cave.event.KEY_COLON "COLON" Colon
cave.event.KEY_COMMA "COMMA" Comma
cave.event.KEY_COMPUTER "COMPUTER" Computer
cave.event.KEY_COPY "COPY" Copy
cave.event.KEY_CRSEL "CRSEL" Crsel
cave.event.KEY_CURRENCYSUBUNIT "CURRENCYSUBUNIT" Currencysubunit
cave.event.KEY_CURRENCYUNIT "CURRENCYUNIT" Currencyunit
cave.event.KEY_CUT "CUT" Cut
cave.event.KEY_D "D" D
cave.event.KEY_DECIMALSEPARATOR "DECIMALSEPARATOR" Decimalseparator
cave.event.KEY_DELETE "DELETE" Delete
cave.event.KEY_DISPLAYSWITCH "DISPLAYSWITCH" Displayswitch
cave.event.KEY_DOLLAR "DOLLAR" Dollar
cave.event.KEY_DOWN "DOWN" Down
cave.event.KEY_E "E" E
cave.event.KEY_EJECT "EJECT" Eject
cave.event.KEY_END "END" End
cave.event.KEY_EQUALS "EQUALS" Equals
cave.event.KEY_ESCAPE "ESCAPE" Escape
cave.event.KEY_EXCLAIM "EXCLAIM" Exclaim
cave.event.KEY_EXECUTE_ "EXECUTE_" Execute
cave.event.KEY_EXSEL "EXSEL" Exsel
cave.event.KEY_F "F" F
cave.event.KEY_F1 "F1" F1
cave.event.KEY_F10 "F10" F10
cave.event.KEY_F11 "F11" F11
cave.event.KEY_F12 "F12" F12
cave.event.KEY_F13 "F13" F13
cave.event.KEY_F14 "F14" F14
cave.event.KEY_F15 "F15" F15
cave.event.KEY_F16 "F16" F16
cave.event.KEY_F17 "F17" F17
cave.event.KEY_F18 "F18" F18
cave.event.KEY_F19 "F19" F19
cave.event.KEY_F2 "F2" F2
cave.event.KEY_F20 "F20" F20
cave.event.KEY_F21 "F21" F21
cave.event.KEY_F22 "F22" F22
cave.event.KEY_F23 "F23" F23
cave.event.KEY_F24 "F24" F24
cave.event.KEY_F3 "F3" F3
cave.event.KEY_F4 "F4" F4
cave.event.KEY_F5 "F5" F5
cave.event.KEY_F6 "F6" F6
cave.event.KEY_F7 "F7" F7
cave.event.KEY_F8 "F8" F8
cave.event.KEY_F9 "F9" F9
cave.event.KEY_FIND "FIND" Find
cave.event.KEY_G "G" G
cave.event.KEY_GREATER "GREATER" Greater
cave.event.KEY_H "H" H
cave.event.KEY_HASH "HASH" Hash
cave.event.KEY_HELP "HELP" Help
cave.event.KEY_HOME "HOME" Home
cave.event.KEY_I "I" I
cave.event.KEY_INSERT "INSERT" Insert
cave.event.KEY_J "J" J
cave.event.KEY_K "K" K
cave.event.KEY_KBDILLUMDOWN "KBDILLUMDOWN" Kbdillumdown
cave.event.KEY_KBDILLUMTOGGLE "KBDILLUMTOGGLE" Kbdillumtoggle
cave.event.KEY_KBDILLUMUP "KBDILLUMUP" Kbdillumup
cave.event.KEY_KP_0 "KP_0" Kp 0
cave.event.KEY_KP_00 "KP_00" Kp 00
cave.event.KEY_KP_000 "KP_000" Kp 000
cave.event.KEY_KP_1 "KP_1" Kp 1
cave.event.KEY_KP_2 "KP_2" Kp 2
cave.event.KEY_KP_3 "KP_3" Kp 3
cave.event.KEY_KP_4 "KP_4" Kp 4
cave.event.KEY_KP_5 "KP_5" Kp 5
cave.event.KEY_KP_6 "KP_6" Kp 6
cave.event.KEY_KP_7 "KP_7" Kp 7
cave.event.KEY_KP_8 "KP_8" Kp 8
cave.event.KEY_KP_9 "KP_9" Kp 9
cave.event.KEY_KP_A "KP_A" Kp A
cave.event.KEY_KP_AMPERSAND "KP_AMPERSAND" Kp Ampersand
cave.event.KEY_KP_AT "KP_AT" Kp At
cave.event.KEY_KP_B "KP_B" Kp B
cave.event.KEY_KP_BACKSPACE "KP_BACKSPACE" Kp Backspace
cave.event.KEY_KP_BINARY "KP_BINARY" Kp Binary
cave.event.KEY_KP_C "KP_C" Kp C
cave.event.KEY_KP_CLEAR "KP_CLEAR" Kp Clear
cave.event.KEY_KP_CLEARENTRY "KP_CLEARENTRY" Kp Clearentry
cave.event.KEY_KP_COLON "KP_COLON" Kp Colon
cave.event.KEY_KP_COMMA "KP_COMMA" Kp Comma
cave.event.KEY_KP_D "KP_D" Kp D
cave.event.KEY_KP_DBLAMPERSAND "KP_DBLAMPERSAND" Kp Dblampersand
cave.event.KEY_KP_DBLVERTICALBAR "KP_DBLVERTICALBAR" Kp Dblverticalbar
cave.event.KEY_KP_DECIMAL "KP_DECIMAL" Kp Decimal
cave.event.KEY_KP_DIVIDE "KP_DIVIDE" Kp Divide
cave.event.KEY_KP_E "KP_E" Kp E
cave.event.KEY_KP_ENTER "KP_ENTER" Kp Enter
cave.event.KEY_KP_EQUALS "KP_EQUALS" Kp Equals
cave.event.KEY_KP_EQUALSAS400 "KP_EQUALSAS400" Kp Equalsas400
cave.event.KEY_KP_EXCLAM "KP_EXCLAM" Kp Exclam
cave.event.KEY_KP_F "KP_F" Kp F
cave.event.KEY_KP_GREATER "KP_GREATER" Kp Greater
cave.event.KEY_KP_HASH "KP_HASH" Kp Hash
cave.event.KEY_KP_HEXADECIMAL "KP_HEXADECIMAL" Kp Hexadecimal
cave.event.KEY_KP_LEFTBRACE "KP_LEFTBRACE" Kp Leftbrace
cave.event.KEY_KP_LEFTPAREN "KP_LEFTPAREN" Kp Leftparen
cave.event.KEY_KP_LESS "KP_LESS" Kp Less
cave.event.KEY_KP_MEMADD "KP_MEMADD" Kp Memadd
cave.event.KEY_KP_MEMCLEAR "KP_MEMCLEAR" Kp Memclear
cave.event.KEY_KP_MEMDIVIDE "KP_MEMDIVIDE" Kp Memdivide
cave.event.KEY_KP_MEMMULTIPLY "KP_MEMMULTIPLY" Kp Memmultiply
cave.event.KEY_KP_MEMRECALL "KP_MEMRECALL" Kp Memrecall
cave.event.KEY_KP_MEMSTORE "KP_MEMSTORE" Kp Memstore
cave.event.KEY_KP_MEMSUBTRACT "KP_MEMSUBTRACT" Kp Memsubtract
cave.event.KEY_KP_MINUS "KP_MINUS" Kp Minus
cave.event.KEY_KP_MULTIPLY "KP_MULTIPLY" Kp Multiply
cave.event.KEY_KP_OCTAL "KP_OCTAL" Kp Octal
cave.event.KEY_KP_PERCENT "KP_PERCENT" Kp Percent
cave.event.KEY_KP_PERIOD "KP_PERIOD" Kp Period
cave.event.KEY_KP_PLUS "KP_PLUS" Kp Plus
cave.event.KEY_KP_PLUSMINUS "KP_PLUSMINUS" Kp Plusminus
cave.event.KEY_KP_POWER "KP_POWER" Kp Power
cave.event.KEY_KP_RIGHTBRACE "KP_RIGHTBRACE" Kp Rightbrace
cave.event.KEY_KP_RIGHTPAREN "KP_RIGHTPAREN" Kp Rightparen
cave.event.KEY_KP_SPACE "KP_SPACE" Kp Space
cave.event.KEY_KP_TAB "KP_TAB" Kp Tab
cave.event.KEY_KP_VERTICALBAR "KP_VERTICALBAR" Kp Verticalbar
cave.event.KEY_KP_XOR "KP_XOR" Kp Xor
cave.event.KEY_L "L" L
cave.event.KEY_LALT "LALT" Lalt
cave.event.KEY_LCTRL "LCTRL" Lctrl
cave.event.KEY_LEFT "LEFT" Left
cave.event.KEY_LEFTBRACKET "LEFTBRACKET" Leftbracket
cave.event.KEY_LEFTPAREN "LEFTPAREN" Leftparen
cave.event.KEY_LESS "LESS" Less
cave.event.KEY_LGUI "LGUI" Lgui
cave.event.KEY_LSHIFT "LSHIFT" Lshift
cave.event.KEY_M "M" M
cave.event.KEY_MAIL "MAIL" Mail
cave.event.KEY_MEDIASELECT "MEDIASELECT" Mediaselect
cave.event.KEY_MENU "MENU" Menu
cave.event.KEY_MINUS "MINUS" Minus
cave.event.KEY_MODE "MODE" Mode
cave.event.KEY_MUTE "MUTE" Mute
cave.event.KEY_N "N" N
cave.event.KEY_NUMLOCKCLEAR "NUMLOCKCLEAR" Numlockclear
cave.event.KEY_O "O" O
cave.event.KEY_OPER "OPER" Oper
cave.event.KEY_OUT "OUT" Out
cave.event.KEY_P "P" P
cave.event.KEY_PAGEDOWN "PAGEDOWN" Pagedown
cave.event.KEY_PAGEUP "PAGEUP" Pageup
cave.event.KEY_PASTE "PASTE" Paste
cave.event.KEY_PAUSE "PAUSE" Pause
cave.event.KEY_PERCENT "PERCENT" Percent
cave.event.KEY_PERIOD "PERIOD" Period
cave.event.KEY_PLUS "PLUS" Plus
cave.event.KEY_POWER "POWER" Power
cave.event.KEY_PRINTSCREEN "PRINTSCREEN" Printscreen
cave.event.KEY_PRIOR "PRIOR" Prior
cave.event.KEY_Q "Q" Q
cave.event.KEY_QUESTION "QUESTION" Question
cave.event.KEY_QUOTE "QUOTE" Quote
cave.event.KEY_QUOTEDBL "QUOTEDBL" Quotedbl
cave.event.KEY_R "R" R
cave.event.KEY_RALT "RALT" Ralt
cave.event.KEY_RCTRL "RCTRL" Rctrl
cave.event.KEY_RETURN "RETURN" Return
cave.event.KEY_RETURN2 "RETURN2" Return2
cave.event.KEY_RGUI "RGUI" Rgui
cave.event.KEY_RIGHT "RIGHT" Right
cave.event.KEY_RIGHTBRACKET "RIGHTBRACKET" Rightbracket
cave.event.KEY_RIGHTPAREN "RIGHTPAREN" Rightparen
cave.event.KEY_RSHIFT "RSHIFT" Rshift
cave.event.KEY_S "S" S
cave.event.KEY_SCROLLLOCK "SCROLLLOCK" Scrolllock
cave.event.KEY_SELECT "SELECT" Select
cave.event.KEY_SEMICOLON "SEMICOLON" Semicolon
cave.event.KEY_SEPARATOR "SEPARATOR" Separator
cave.event.KEY_SIZE "SIZE" Size
cave.event.KEY_SLASH "SLASH" Slash
cave.event.KEY_SLEEP "SLEEP" Sleep
cave.event.KEY_SPACE "SPACE" Space
cave.event.KEY_STOP "STOP" Stop
cave.event.KEY_SYSREQ "SYSREQ" Sysreq
cave.event.KEY_T "T" T
cave.event.KEY_TAB "TAB" Tab
cave.event.KEY_THOUSANDSSEPARATOR "THOUSANDSSEPARATOR" Thousandsseparator
cave.event.KEY_U "U" U
cave.event.KEY_UNDO "UNDO" Undo
cave.event.KEY_UNKNOWN "UNKNOWN" Unknown
cave.event.KEY_UP "UP" Up
cave.event.KEY_V "V" V
cave.event.KEY_VOLUMEDOWN "VOLUMEDOWN" Volumedown
cave.event.KEY_VOLUMEUP "VOLUMEUP" Volumeup
cave.event.KEY_W "W" W
cave.event.KEY_WWW "WWW" Www
cave.event.KEY_X "X" X
cave.event.KEY_Y "Y" Y
cave.event.KEY_Z "Z" Z