API reference
hotkeysLua table
Read keyboard input from a Lua script.
The hotkeys table reads Windows virtual key codes. Use it in a loaded module to react to a key without repeating an action on every update.
hotkeys.down(vk)
Parameters: vk is a Windows virtual key code from 1 to 255. Returns: true while the key is down, false otherwise, or nil, error for an invalid code.
if hotkeys.down(0x70) then
log.info("F1 is held")
endhotkeys.pressed(vk)
Parameters: vk follows the same key-code rule. Returns: true once per key press in this script, false otherwise, or nil, error for an invalid code.
function on_tick()
if hotkeys.pressed(0x70) then
log.info("F1 pressed")
end
end