Input

keyclick

Sends a key down event followed by a key up event when the Roblox window is active.

Syntax

keyclick(keyCode: number)
Aliases keytap

Arguments

NameTypeDescription
keyCodenumberWindows virtual-key code read as a Lua number and converted to an integer before Windows key mapping is called.

Description

Sends a key down event followed by a key up event when the Roblox window is active. The keyCode argument is checked as a Lua number, and sent with keyboard input with KEYEVENTF_SCANCODE. If isrbxactive would be false, the function returns without sending input.

Call it with 1 parameter(s): keyCode. The argument table explains which values are required and which ones only refine the behavior.

It does not return data. Treat the call as an action and handle errors around the call site when needed.

Example

Example call with placeholder values.

keyclick(1)