Skip to content

key

Check whether a key is held. key and key_down are the same function.

Parameters

  • name — A key name ("left") or a KEY_* constant.
if key(KEY_LEFT) then self.x = self.x - 3 end

Related: key_pressed, key_released.

See the keyboard guide for more examples and limits.