isKeyDown

For checking if a key is currently pressed down. This will continue to report true, until the user is no longer holding the key down.

.isKeyDown()

Returns true if any key is currently down.

if getControls().isKeyDown()
    // do something
end

.isKeyDown( key )

Given the name of a key, this will return true if it is currently down. The name should be a string or symbol for that key.

if getControls().isKeyDown( :up )
    player.moveForward()
else if if getControls().isKeyDown( :down )
    player.moveBack()
end

.isKeyDown( [ keys ] )

isKeyDown can also take an array of keys to check for. If any of these keys are pressed, then true is returned.

if getControls().isKeyDown([ :w, :up ])
    player.moveForward()
else if if getControls().isKeyDown([ :s, :down ])
    player.moveBack()
end

See also

Available Keys - isKeyPressed - isKeyReleased