Skip to content

getKeyState

Gets the async key state (Windows API).

Syntax

lua
Ham.getKeyState(key)

Parameters

NameTypeDescription
keyintegerVirtual key code

Returns

  • integer - Key state value

Example

lua
local state = Ham.getKeyState(0x01) -- Left mouse button
if state ~= 0 then
    print("Left mouse is pressed")
end

See Also

Released under the ISC License.