IsKeyBeingPressed
This function was added in DSL 1
Description
Check if a keyboard key was just pressed.
This should be a string representing the key, such as 'W'
, 'A'
, 'S'
, 'D'
, etc. The key names are case-sensitive.
function IsKeyBeingPressed(key) --[[ ... ]] end
Parameters
key
:string
- The name of the key to check.
Return Values
justPressed
:boolean
- Returnstrue
if the key was just pressed, otherwisefalse
.
Example
if IsKeyBeingPressed('W') then
print('W key was just pressed!')
end
See Also
- DSL
IsKeyPressed
- Check if a key is being held down.IsKeyBeingReleased
- Check if a key was just released.