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
- Returnstrue
if the key is currently pressed, otherwisefalse
.
Example
if IsKeyPressed('W') then
print('W key is currently pressed!')
end
See Also
- DSL
IsKeyBeingPressed
- Check if a key was just pressed.IsKeyBeingReleased
- Check if a key was just released.