INPUT FUNCTIONS

GetAsyncKeyState

Returns whether a virtual key is currently held down.

Syntax

local down, pressed = ONYX.GetAsyncKeyState(vk)

Parameters

  • vk (integer) — Windows virtual-key code (0x41 = A, 0xA0 = VK_LSHIFT).

Return(s)

down (boolean) — true while held; pressed (boolean) — true on the up-to-down transition since the last OS query.

Example(s)

local down, pressed = ONYX.GetAsyncKeyState(0x41)
if pressed then print("A pressed") end