Class engine.Key

Basic keypress handler The engine calls receiveKey when a key is pressed

Fields

engine.Key._UNKNOWN

engine.Key._a

engine.Key._b

engine.Key._c

engine.Key._d

engine.Key._e

engine.Key._f

engine.Key._g

engine.Key._h

engine.Key._i

engine.Key._j

engine.Key._k

engine.Key._l

engine.Key._m

engine.Key._n

engine.Key._o

engine.Key._p

engine.Key._q

engine.Key._r

engine.Key._s

engine.Key._t

engine.Key._u

engine.Key._v

engine.Key._w

engine.Key._x

engine.Key._y

engine.Key._z

engine.Key._1

engine.Key._2

engine.Key._3

engine.Key._4

engine.Key._5

engine.Key._6

engine.Key._7

engine.Key._8

engine.Key._9

engine.Key._0

engine.Key._RETURN

engine.Key._ESCAPE

engine.Key._BACKSPACE

engine.Key._TAB

engine.Key._SPACE

engine.Key._MINUS

engine.Key._EQUALS

engine.Key._LEFTBRACKET

engine.Key._RIGHTBRACKET

engine.Key._BACKSLASH

engine.Key._NONUSHASH

engine.Key._SEMICOLON

engine.Key._APOSTROPHE

engine.Key._GRAVE

engine.Key._COMMA

engine.Key._PERIOD

engine.Key._SLASH

engine.Key._CAPSLOCK

engine.Key._F1

engine.Key._F2

engine.Key._F3

engine.Key._F4

engine.Key._F5

engine.Key._F6

engine.Key._F7

engine.Key._F8

engine.Key._F9

engine.Key._F10

engine.Key._F11

engine.Key._F12

engine.Key._PRINTSCREEN

engine.Key._SCROLLLOCK

engine.Key._PAUSE

engine.Key._INSERT

engine.Key._HOME

engine.Key._PAGEUP

engine.Key._DELETE

engine.Key._END

engine.Key._PAGEDOWN

engine.Key._RIGHT

engine.Key._LEFT

engine.Key._DOWN

engine.Key._UP

engine.Key._NUMLOCKCLEAR

engine.Key._KP_DIVIDE

engine.Key._KP_MULTIPLY

engine.Key._KP_MINUS

engine.Key._KP_PLUS

engine.Key._KP_ENTER

engine.Key._KP_1

engine.Key._KP_2

engine.Key._KP_3

engine.Key._KP_4

engine.Key._KP_5

engine.Key._KP_6

engine.Key._KP_7

engine.Key._KP_8

engine.Key._KP_9

engine.Key._KP_0

engine.Key._KP_PERIOD

engine.Key._NONUSBACKSLASH

engine.Key._APPLICATION

engine.Key._POWER

engine.Key._KP_EQUALS

engine.Key._F13

engine.Key._F14

engine.Key._F15

engine.Key._F16

engine.Key._F17

engine.Key._F18

engine.Key._F19

engine.Key._F20

engine.Key._F21

engine.Key._F22

engine.Key._F23

engine.Key._F24

engine.Key._EXECUTE

engine.Key._HELP

engine.Key._MENU

engine.Key._SELECT

engine.Key._STOP

engine.Key._AGAIN

engine.Key._UNDO

engine.Key._CUT

engine.Key._COPY

engine.Key._PASTE

engine.Key._FIND

engine.Key._MUTE

engine.Key._VOLUMEUP

engine.Key._VOLUMEDOWN

engine.Key._KP_COMMA

engine.Key._KP_EQUALSAS400

engine.Key._INTERNATIONAL1

engine.Key._INTERNATIONAL2

engine.Key._INTERNATIONAL3

engine.Key._INTERNATIONAL4

engine.Key._INTERNATIONAL5

engine.Key._INTERNATIONAL6

engine.Key._INTERNATIONAL7

engine.Key._INTERNATIONAL8

engine.Key._INTERNATIONAL9

engine.Key._LANG1

engine.Key._LANG2

engine.Key._LANG3

engine.Key._LANG4

engine.Key._LANG5

engine.Key._LANG6

engine.Key._LANG7

engine.Key._LANG8

engine.Key._LANG9

engine.Key._ALTERASE

engine.Key._SYSREQ

engine.Key._CANCEL

engine.Key._CLEAR

engine.Key._PRIOR

engine.Key._RETURN2

engine.Key._SEPARATOR

engine.Key._OUT

engine.Key._OPER

engine.Key._CLEARAGAIN

engine.Key._CRSEL

engine.Key._EXSEL

engine.Key._KP_00

engine.Key._KP_000

engine.Key._THOUSANDSSEPARATOR

engine.Key._DECIMALSEPARATOR

engine.Key._CURRENCYUNIT

engine.Key._CURRENCYSUBUNIT

engine.Key._KP_LEFTPAREN

engine.Key._KP_RIGHTPAREN

engine.Key._KP_LEFTBRACE

engine.Key._KP_RIGHTBRACE

engine.Key._KP_TAB

engine.Key._KP_BACKSPACE

engine.Key._KP_A

engine.Key._KP_B

engine.Key._KP_C

engine.Key._KP_D

engine.Key._KP_E

engine.Key._KP_F

engine.Key._KP_XOR

engine.Key._KP_POWER

engine.Key._KP_PERCENT

engine.Key._KP_LESS

engine.Key._KP_GREATER

engine.Key._KP_AMPERSAND

engine.Key._KP_DBLAMPERSAND

engine.Key._KP_VERTICALBAR

engine.Key._KP_DBLVERTICALBAR

engine.Key._KP_COLON

engine.Key._KP_HASH

engine.Key._KP_SPACE

engine.Key._KP_AT

engine.Key._KP_EXCLAM

engine.Key._KP_MEMSTORE

engine.Key._KP_MEMRECALL

engine.Key._KP_MEMCLEAR

engine.Key._KP_MEMADD

engine.Key._KP_MEMSUBTRACT

engine.Key._KP_MEMMULTIPLY

engine.Key._KP_MEMDIVIDE

engine.Key._KP_PLUSMINUS

engine.Key._KP_CLEAR

engine.Key._KP_CLEARENTRY

engine.Key._KP_BINARY

engine.Key._KP_OCTAL

engine.Key._KP_DECIMAL

engine.Key._KP_HEXADECIMAL

engine.Key._LCTRL

engine.Key._LSHIFT

engine.Key._LALT

engine.Key._LGUI

engine.Key._RCTRL

engine.Key._RSHIFT

engine.Key._RALT

engine.Key._RGUI

engine.Key._MODE

engine.Key._AUDIONEXT

engine.Key._AUDIOPREV

engine.Key._AUDIOSTOP

engine.Key._AUDIOPLAY

engine.Key._AUDIOMUTE

engine.Key._MEDIASELECT

engine.Key._WWW

engine.Key._MAIL

engine.Key._CALCULATOR

engine.Key._COMPUTER

engine.Key._AC_SEARCH

engine.Key._AC_HOME

engine.Key._AC_BACK

engine.Key._AC_FORWARD

engine.Key._AC_STOP

engine.Key._AC_REFRESH

engine.Key._AC_BOOKMARKS

engine.Key._BRIGHTNESSDOWN

engine.Key._BRIGHTNESSUP

engine.Key._DISPLAYSWITCH

engine.Key._KBDILLUMTOGGLE

engine.Key._KBDILLUMDOWN

engine.Key._KBDILLUMUP

engine.Key._EJECT

engine.Key._SLEEP

engine.Key.__DEFAULT

engine.Key.__TEXTINPUT

Methods

engine.Key:init ()

Init

engine.Key:receiveKey (sym, ctrl, shift, alt, meta, unicode, isup, key)

Called when a key is pressed

engine.Key:receiveKeyRaw (isup, scancode, sym, unicode, ctrl, shift, alt, meta)

Called when a key is pressed, gives raw codes

engine.Key:receiveJoyButton (button, isup)

Called when a gamepad key is pressed

engine.Key:handleStatus (sym, ctrl, shift, alt, meta, unicode, isup)

Maintain the self.status table, which can be used to know if a key is currently pressed

engine.Key:setCurrent ()

Setup as the current game keyhandler



Fields

engine.Key._UNKNOWN
  • _UNKNOWN 0
engine.Key._a
  • _a 4
engine.Key._b
  • _b 5
engine.Key._c
  • _c 6
engine.Key._d
  • _d 7
engine.Key._e
  • _e 8
engine.Key._f
  • _f 9
engine.Key._g
  • _g 10
engine.Key._h
  • _h 11
engine.Key._i
  • _i 12
engine.Key._j
  • _j 13
engine.Key._k
  • _k 14
engine.Key._l
  • _l 15
engine.Key._m
  • _m 16
engine.Key._n
  • _n 17
engine.Key._o
  • _o 18
engine.Key._p
  • _p 19
engine.Key._q
  • _q 20
engine.Key._r
  • _r 21
engine.Key._s
  • _s 22
engine.Key._t
  • _t 23
engine.Key._u
  • _u 24
engine.Key._v
  • _v 25
engine.Key._w
  • _w 26
engine.Key._x
  • _x 27
engine.Key._y
  • _y 28
engine.Key._z
  • _z 29
engine.Key._1
  • _1 30
engine.Key._2
  • _2 31
engine.Key._3
  • _3 32
engine.Key._4
  • _4 33
engine.Key._5
  • _5 34
engine.Key._6
  • _6 35
engine.Key._7
  • _7 36
engine.Key._8
  • _8 37
engine.Key._9
  • _9 38
engine.Key._0
  • _0 39
engine.Key._RETURN
  • _RETURN 40
engine.Key._ESCAPE
  • _ESCAPE 41
engine.Key._BACKSPACE
  • _BACKSPACE 42
engine.Key._TAB
  • _TAB 43
engine.Key._SPACE
  • _SPACE 44
engine.Key._MINUS
  • _MINUS 45
engine.Key._EQUALS
  • _EQUALS 46
engine.Key._LEFTBRACKET
  • _LEFTBRACKET 47
engine.Key._RIGHTBRACKET
  • _RIGHTBRACKET 48
engine.Key._BACKSLASH
  • _BACKSLASH 49
engine.Key._NONUSHASH
  • _NONUSHASH 50
engine.Key._SEMICOLON
  • _SEMICOLON 51
engine.Key._APOSTROPHE
  • _APOSTROPHE 52
engine.Key._GRAVE
  • _GRAVE 53
engine.Key._COMMA
  • _COMMA 54
engine.Key._PERIOD
  • _PERIOD 55
engine.Key._SLASH
  • _SLASH 56
engine.Key._CAPSLOCK
  • _CAPSLOCK 57
engine.Key._F1
  • _F1 58
engine.Key._F2
  • _F2 59
engine.Key._F3
  • _F3 60
engine.Key._F4
  • _F4 61
engine.Key._F5
  • _F5 62
engine.Key._F6
  • _F6 63
engine.Key._F7
  • _F7 64
engine.Key._F8
  • _F8 65
engine.Key._F9
  • _F9 66
engine.Key._F10
  • _F10 67
engine.Key._F11
  • _F11 68
engine.Key._F12
  • _F12 69
engine.Key._PRINTSCREEN
  • _PRINTSCREEN 70
engine.Key._SCROLLLOCK
  • _SCROLLLOCK 71
engine.Key._PAUSE
  • _PAUSE 72
engine.Key._INSERT
  • _INSERT 73
engine.Key._HOME
  • _HOME 74
engine.Key._PAGEUP
  • _PAGEUP 75
engine.Key._DELETE
  • _DELETE 76
engine.Key._END
  • _END 77
engine.Key._PAGEDOWN
  • _PAGEDOWN 78
engine.Key._RIGHT
  • _RIGHT 79
engine.Key._LEFT
  • _LEFT 80
engine.Key._DOWN
  • _DOWN 81
engine.Key._UP
  • _UP 82
engine.Key._NUMLOCKCLEAR
  • _NUMLOCKCLEAR 83
engine.Key._KP_DIVIDE
  • _KP_DIVIDE 84
engine.Key._KP_MULTIPLY
  • _KP_MULTIPLY 85
engine.Key._KP_MINUS
  • _KP_MINUS 86
engine.Key._KP_PLUS
  • _KP_PLUS 87
engine.Key._KP_ENTER
  • _KP_ENTER 88
engine.Key._KP_1
  • _KP_1 89
engine.Key._KP_2
  • _KP_2 90
engine.Key._KP_3
  • _KP_3 91
engine.Key._KP_4
  • _KP_4 92
engine.Key._KP_5
  • _KP_5 93
engine.Key._KP_6
  • _KP_6 94
engine.Key._KP_7
  • _KP_7 95
engine.Key._KP_8
  • _KP_8 96
engine.Key._KP_9
  • _KP_9 97
engine.Key._KP_0
  • _KP_0 98
engine.Key._KP_PERIOD
  • _KP_PERIOD 99
engine.Key._NONUSBACKSLASH
  • _NONUSBACKSLASH 100
engine.Key._APPLICATION
  • _APPLICATION 101
engine.Key._POWER
  • _POWER 102
engine.Key._KP_EQUALS
  • _KP_EQUALS 103
engine.Key._F13
  • _F13 104
engine.Key._F14
  • _F14 105
engine.Key._F15
  • _F15 106
engine.Key._F16
  • _F16 107
engine.Key._F17
  • _F17 108
engine.Key._F18
  • _F18 109
engine.Key._F19
  • _F19 110
engine.Key._F20
  • _F20 111
engine.Key._F21
  • _F21 112
engine.Key._F22
  • _F22 113
engine.Key._F23
  • _F23 114
engine.Key._F24
  • _F24 115
engine.Key._EXECUTE
  • _EXECUTE 116
engine.Key._HELP
  • _HELP 117
engine.Key._MENU
  • _MENU 118
engine.Key._SELECT
  • _SELECT 119
engine.Key._STOP
  • _STOP 120
engine.Key._AGAIN
  • _AGAIN 121
engine.Key._UNDO
  • _UNDO 122
engine.Key._CUT
  • _CUT 123
engine.Key._COPY
  • _COPY 124
engine.Key._PASTE
  • _PASTE 125
engine.Key._FIND
  • _FIND 126
engine.Key._MUTE
  • _MUTE 127
engine.Key._VOLUMEUP
  • _VOLUMEUP 128
engine.Key._VOLUMEDOWN
  • _VOLUMEDOWN 129
engine.Key._KP_COMMA
  • _KP_COMMA 133
engine.Key._KP_EQUALSAS400
  • _KP_EQUALSAS400 134
engine.Key._INTERNATIONAL1
  • _INTERNATIONAL1 135
engine.Key._INTERNATIONAL2
  • _INTERNATIONAL2 136
engine.Key._INTERNATIONAL3
  • _INTERNATIONAL3 137
engine.Key._INTERNATIONAL4
  • _INTERNATIONAL4 138
engine.Key._INTERNATIONAL5
  • _INTERNATIONAL5 139
engine.Key._INTERNATIONAL6
  • _INTERNATIONAL6 140
engine.Key._INTERNATIONAL7
  • _INTERNATIONAL7 141
engine.Key._INTERNATIONAL8
  • _INTERNATIONAL8 142
engine.Key._INTERNATIONAL9
  • _INTERNATIONAL9 143
engine.Key._LANG1
  • _LANG1 144
engine.Key._LANG2
  • _LANG2 145
engine.Key._LANG3
  • _LANG3 146
engine.Key._LANG4
  • _LANG4 147
engine.Key._LANG5
  • _LANG5 148
engine.Key._LANG6
  • _LANG6 149
engine.Key._LANG7
  • _LANG7 150
engine.Key._LANG8
  • _LANG8 151
engine.Key._LANG9
  • _LANG9 152
engine.Key._ALTERASE
  • _ALTERASE 153
engine.Key._SYSREQ
  • _SYSREQ 154
engine.Key._CANCEL
  • _CANCEL 155
engine.Key._CLEAR
  • _CLEAR 156
engine.Key._PRIOR
  • _PRIOR 157
engine.Key._RETURN2
  • _RETURN2 158
engine.Key._SEPARATOR
  • _SEPARATOR 159
engine.Key._OUT
  • _OUT 160
engine.Key._OPER
  • _OPER 161
engine.Key._CLEARAGAIN
  • _CLEARAGAIN 162
engine.Key._CRSEL
  • _CRSEL 163
engine.Key._EXSEL
  • _EXSEL 164
engine.Key._KP_00
  • _KP_00 176
engine.Key._KP_000
  • _KP_000 177
engine.Key._THOUSANDSSEPARATOR
  • _THOUSANDSSEPARATOR 178
engine.Key._DECIMALSEPARATOR
  • _DECIMALSEPARATOR 179
engine.Key._CURRENCYUNIT
  • _CURRENCYUNIT 180
engine.Key._CURRENCYSUBUNIT
  • _CURRENCYSUBUNIT 181
engine.Key._KP_LEFTPAREN
  • _KP_LEFTPAREN 182
engine.Key._KP_RIGHTPAREN
  • _KP_RIGHTPAREN 183
engine.Key._KP_LEFTBRACE
  • _KP_LEFTBRACE 184
engine.Key._KP_RIGHTBRACE
  • _KP_RIGHTBRACE 185
engine.Key._KP_TAB
  • _KP_TAB 186
engine.Key._KP_BACKSPACE
  • _KP_BACKSPACE 187
engine.Key._KP_A
  • _KP_A 188
engine.Key._KP_B
  • _KP_B 189
engine.Key._KP_C
  • _KP_C 190
engine.Key._KP_D
  • _KP_D 191
engine.Key._KP_E
  • _KP_E 192
engine.Key._KP_F
  • _KP_F 193
engine.Key._KP_XOR
  • _KP_XOR 194
engine.Key._KP_POWER
  • _KP_POWER 195
engine.Key._KP_PERCENT
  • _KP_PERCENT 196
engine.Key._KP_LESS
  • _KP_LESS 197
engine.Key._KP_GREATER
  • _KP_GREATER 198
engine.Key._KP_AMPERSAND
  • _KP_AMPERSAND 199
engine.Key._KP_DBLAMPERSAND
  • _KP_DBLAMPERSAND 200
engine.Key._KP_VERTICALBAR
  • _KP_VERTICALBAR 201
engine.Key._KP_DBLVERTICALBAR
  • _KP_DBLVERTICALBAR 202
engine.Key._KP_COLON
  • _KP_COLON 203
engine.Key._KP_HASH
  • _KP_HASH 204
engine.Key._KP_SPACE
  • _KP_SPACE 205
engine.Key._KP_AT
  • _KP_AT 206
engine.Key._KP_EXCLAM
  • _KP_EXCLAM 207
engine.Key._KP_MEMSTORE
  • _KP_MEMSTORE 208
engine.Key._KP_MEMRECALL
  • _KP_MEMRECALL 209
engine.Key._KP_MEMCLEAR
  • _KP_MEMCLEAR 210
engine.Key._KP_MEMADD
  • _KP_MEMADD 211
engine.Key._KP_MEMSUBTRACT
  • _KP_MEMSUBTRACT 212
engine.Key._KP_MEMMULTIPLY
  • _KP_MEMMULTIPLY 213
engine.Key._KP_MEMDIVIDE
  • _KP_MEMDIVIDE 214
engine.Key._KP_PLUSMINUS
  • _KP_PLUSMINUS 215
engine.Key._KP_CLEAR
  • _KP_CLEAR 216
engine.Key._KP_CLEARENTRY
  • _KP_CLEARENTRY 217
engine.Key._KP_BINARY
  • _KP_BINARY 218
engine.Key._KP_OCTAL
  • _KP_OCTAL 219
engine.Key._KP_DECIMAL
  • _KP_DECIMAL 220
engine.Key._KP_HEXADECIMAL
  • _KP_HEXADECIMAL 221
engine.Key._LCTRL
  • _LCTRL 224
engine.Key._LSHIFT
  • _LSHIFT 225
engine.Key._LALT
  • _LALT 226
engine.Key._LGUI
  • _LGUI 227
engine.Key._RCTRL
  • _RCTRL 228
engine.Key._RSHIFT
  • _RSHIFT 229
engine.Key._RALT
  • _RALT 230
engine.Key._RGUI
  • _RGUI 231
engine.Key._MODE
  • _MODE 257
engine.Key._AUDIONEXT
  • _AUDIONEXT 258
engine.Key._AUDIOPREV
  • _AUDIOPREV 259
engine.Key._AUDIOSTOP
  • _AUDIOSTOP 260
engine.Key._AUDIOPLAY
  • _AUDIOPLAY 261
engine.Key._AUDIOMUTE
  • _AUDIOMUTE 262
engine.Key._MEDIASELECT
  • _MEDIASELECT 263
engine.Key._WWW
  • _WWW 264
engine.Key._MAIL
  • _MAIL 265
engine.Key._CALCULATOR
  • _CALCULATOR 266
engine.Key._COMPUTER
  • _COMPUTER 267
engine.Key._AC_SEARCH
  • _AC_SEARCH 268
engine.Key._AC_HOME
  • _AC_HOME 269
engine.Key._AC_BACK
  • _AC_BACK 270
engine.Key._AC_FORWARD
  • _AC_FORWARD 271
engine.Key._AC_STOP
  • _AC_STOP 272
engine.Key._AC_REFRESH
  • _AC_REFRESH 273
engine.Key._AC_BOOKMARKS
  • _AC_BOOKMARKS 274
engine.Key._BRIGHTNESSDOWN
  • _BRIGHTNESSDOWN 275
engine.Key._BRIGHTNESSUP
  • _BRIGHTNESSUP 276
engine.Key._DISPLAYSWITCH
  • _DISPLAYSWITCH 277
engine.Key._KBDILLUMTOGGLE
  • _KBDILLUMTOGGLE 278
engine.Key._KBDILLUMDOWN
  • _KBDILLUMDOWN 279
engine.Key._KBDILLUMUP
  • _KBDILLUMUP 280
engine.Key._EJECT
  • _EJECT 281
engine.Key._SLEEP
  • _SLEEP 282
engine.Key.__DEFAULT
  • __DEFAULT -10000
engine.Key.__TEXTINPUT
  • __TEXTINPUT -10001

Methods

engine.Key:init ()
Init
engine.Key:receiveKey (sym, ctrl, shift, alt, meta, unicode, isup, key)
Called when a key is pressed

Parameters:

  • sym number a number representing the key, see all the _FOO fields
  • ctrl boolean is the control key pressed?
  • shift boolean is the shit key pressed?
  • alt boolean is the alt key pressed?
  • meta boolean is the meta key pressed?
  • unicode the unicode representation of the key, if possible
  • isup boolean true if the key was released, false if pressed
  • key string the unicode representation of the key pressed (without accounting for modifiers)
engine.Key:receiveKeyRaw (isup, scancode, sym, unicode, ctrl, shift, alt, meta)
Called when a key is pressed, gives raw codes

Parameters:

  • isup boolean false if pressed, true if released
  • scancode number
  • sym number a number representing the key, see all the _FOO fields
  • unicode the unicode representation of the key, if possible
  • ctrl boolean is the control key pressed?
  • shift boolean is the shit key pressed?
  • alt boolean is the alt key pressed?
  • meta boolean is the meta key pressed?
engine.Key:receiveJoyButton (button, isup)
Called when a gamepad key is pressed

Parameters:

  • button the id
  • isup boolean false if pressed, true if released
engine.Key:handleStatus (sym, ctrl, shift, alt, meta, unicode, isup)
Maintain the self.status table, which can be used to know if a key is currently pressed

Parameters:

  • sym number a number representing the key, see all the _FOO fields
  • ctrl boolean is the control key pressed?
  • shift boolean is the shit key pressed?
  • alt boolean is the alt key pressed?
  • meta boolean is the meta key pressed?
  • unicode the unicode representation of the key, if possible
  • isup boolean false if pressed, true if released
engine.Key:setCurrent ()
Setup as the current game keyhandler
generated by LDoc 1.4.3