Skip to main content

IsKeyPressed

This function was added in DSL 1

Description

Check if a keyboard key is currently pressed.

function IsKeyPressed(key) --[[ ... ]] end

Parameters

  • key: string - The name of the key to check.

Return Values

  • pressed: boolean - Returns true if the key is currently pressed, otherwise false.

Example

if IsKeyPressed('W') then
print('W key is currently pressed!')
end

See Also