Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

Handling input

Evan Bowman edited this page Dec 29, 2016 · 5 revisions

The engine provides some simple abstractions for getting keyboard input:

--[[ This line checks whether the left arrow key is pressed
     and stores the result in 'left' ]]
left = input.keyPressed(input.key.left)

Here is a list of available key codes:

Code Description
left The left arrow key
right The right arrow key
up The up arrow key
down The down arrow key
a The A key
b The B key
... (rest of the english alphabet)
num0 The 0 number key
num1 The 1 number key
... (rest of numbers 0-9)
esc The Escape key
lctrl The left control key
lshift The left shift key
lalt The left alt key
lsuper The left super key
rctrl The right control key
rshift The right shift key
ralt The right alt key
rsuper The right super key
Clone this wiki locally