Lua:createHotkey

From Cheat Engine
Revision as of 19:24, 23 June 2026 by Leunsel (talk | contribs) (Initial page creation.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

<> Reference

function createHotkey(callback, keys, ...) : GenericHotkey

Creates and registers a GenericHotkey.

A hotkey accepts at most five keys. Pass keys as separate arguments or as a table.

Function Parameters

Parameter Type Description
callback Function Function to run when the key combination is pressed.
keys Integer or table One to five virtual-key codes, supplied separately or in a table.

Returns

GenericHotkey — The initialized hotkey object.

Examples

local hotkey = createHotkey(function()
  showMessage("Hotkey pressed")
end, VK_F1)

See Also

Main Pages