isKeyPressed

For checking if a key has been pressed on this frame. If the key is down, but was pressed on a previous frame, then false is returned.

.isKeyPressed()

Returns true if any key was pressed on this frame.

This is useful for allowing users to skip intros, and any in-game scenes.

if getControls().isKeyPressed()
    skipIntro()
end

.isKeyPressed( key )

Given the name of a key, this will return true if it was pressed on this frame, and false if it was not.

if getControls().isKeyPressed( :ctrl )
    player.shoot()
end

.isKeyPressed( [ keys ] )

An array of keys to check for can also be given. This will return true if any of those keys were pressed.

if getControls().isKeyPressed( [ :ctrl, :space ] )
    player.shoot()
end

See also

Available Keys - isKeyDown - isKeyReleased