lovr.system.wasKeyPressed

Edit

Returns whether a key on the keyboard was pressed this frame.

pressed = lovr.system.wasKeyPressed(...)

Arguments

NameTypeDescription
...KeyCode The set of keys to check.

Returns

NameTypeDescription
pressedboolean Whether any of the specified keys were pressed this frame.

Notes

Technically this returns whether the key was pressed between the last 2 calls to lovr.system.pollEvents, but that function is called automatically at the beginning of each frame in lovr.run, so it all works out!

See also