Skip to content

on_key_pressed(key_code, is_char)

Type Name Description
number key_code Code of key that was pressed
bool is_char True if key is a printable character

Called when any key was pressed.

1
2
3
4
5
function on_key_pressed(key_code, is_char)
    if key_code == 0x1 then
        -- mouse1 was pressed...
    end
end