lovr.keypressed

Edit

This callback is called when a key is pressed.

function lovr.keypressed(key, scancode, isrepeat)
  -- your code here
end

Arguments

NameTypeDescription
keyKeyCode The key that was pressed.
scancodenumber The id of the key (ignores keyboard layout, may vary between keyboards).
isrepeatboolean Whether the event is the result of a key repeat instead of an actual press.

Returns

Nothing

Notes

By default this will be fired only once while a key is held down. This can be changed to fire multiple times by setting lovr.system.setKeyRepeat to true. In that case isrepeat will become true whenever the event is the result of a key repeat and false on a single press.

See also