keyclick

Presses and releases a key.

Syntax

Signature
keyclick(Code: number) -> boolean

Aliases

  • keytap

Parameters

ParameterTypeDescription
CodenumberWindows virtual-key code from 8 to 254.

Returns

TypeDescription
booleanWhether the platform accepted both events.

Notes

Code uses Windows virtual-key numbering from 8 through 254. macOS translates supported codes to native keys. Invalid codes raise an error.

Example

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