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.

Syntax
Luau
keypress(keyCode: number) -> ()

Parameters

Function parameters
ParameterTypeDescription
keyCodenumberNumeric key code understood by the input bridge.

Returns

()

This function returns no values.

Example

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
Kawaii documentation