Skip to main content

GetAnyKeyBeingPressed

This function was added in DSL 1

Description

Returns any keyId that would satisfy IsKeyBeingPressed.

function GetAnyKeyBeingPressed() --[[ ... ]] end

Parameters

None.

Return Values

  • keyId: integer - The ID of the key that was just pressed. nil if no key was pressed.

Example

function main()
while true do
local key = GetAnyKeyBeingPressed()
if key then
DrawTextInline('Key ID ' .. tostring(key) .. ' was just pressed!', 0, 1)
end
Wait(0)
end
end

See Also