Volt

keyclick

Simulates a complete key press and release.

Syntax

keyclick(keycode: number) -> void

Parameters

ParameterTypeDescription
keycodenumberVirtual key code

Returns

This function does not return a value.

Description

keyclick simulates pressing and releasing a keyboard key in one operation.

Example

-- Click the E key
keyclick(0x45)

-- Click space multiple times
for i = 1, 5 do
    keyclick(0x20)
    task.wait(0.1)
end

On this page