keypress Synchronous
keytap
Press and hold the key identified by its numeric key code. Use it to represent the beginning of a held key in a local input interaction. Pair it with keyrelease for the same code; keyclick is the shorter form for a complete tap.
Luau
keypress(keyCode: number) -> ()Parameters
| Parameter | Type | Description |
|---|---|---|
keyCode | number | Numeric key code understood by the input bridge. |
Returns
()This function returns no values.
Example
Luau
-- Focus an editable field in your own test UI during this delay.
task.wait(3)
if isrbxactive() then
keypress(0x41) -- A
keyrelease(0x41)
end