GetKeyState
Gets the last time a game tick happened.
-- Find CGKeyCode's here -- https://github.com/phracker/MacOSX-SDKs/blob/master/MacOSX10.6.sdk/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/Headers/Events.h#L198GetKeyState(CGKeyCode) : boolean
Example
local keybindings = {} function OnKeysDown(keys)for k, v in pairs(keys) doif not GetKeyState(v) thenreturn falseendendreturn trueend function RegisterKeyBinding(keys, callback)table.insert(keybindings, { keys = keys, callback = callback })end C_Timer.NewTicker(0.001, function()for k, v in pairs(keybindings) doif OnKeysDown(v.keys) thenif not v.fired thenv.fired = truev.callback(true)endelsev.fired = nilendendend) RegisterKeyBinding({ 0x38, 0x00 }, function()print("Shift+a executed")end)