natiny.input.get_key_released

Lua
natiny.input.get_key_released(key) -> boolean

Returns true only on the frame when the specified key was released.

Parameters

Name Type Description
key number Key code - a natiny.input.KEY_* constant, e.g. natiny.input.KEY_W

Returns

Type Description
boolean true on the frame the key was released, false otherwise

Example

Lua
if natiny.input.get_key_released(natiny.input.KEY_ESCAPE) then
    close_menu()
end

Notes

  • Returns true for the frame that consumes a pressed-to-released transition.
  • Key constants are listed in Key codes.