keypress
Presses a key.
Syntax
Signature
keypress(Code: number) -> booleanAliases
This function has no aliases.
Parameters
| Parameter | Type | Description |
|---|---|---|
Code | number | Windows virtual-key code from 8 to 254. |
Returns
| Type | Description |
|---|---|
boolean | Whether 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)