keypress

Presses a key.

Syntax

Signature
keypress(Code: number) -> boolean

Aliases

This function has no aliases.

Parameters

ParameterTypeDescription
CodenumberWindows virtual-key code from 8 to 254.

Returns

TypeDescription
booleanWhether the platform accepted the event.

Notes

macOS translates supported codes to native keys. Pair it with keyrelease when holding a key.

Example

Luau
local Result = keypress(65)
print(Result)