Originally Posted by zgrssd
So dynamically defining Keybinds is not possible, I got that.
But what about dynamically assigning the keybind up/down callbacks? Anybody got an idea where I could find the list/table of Keybindings?
/zgoo _G has no obvious entry I could find.
Say, I make Keybinds 1-5 in XML but without any callback. Maybe I even tell them not to be shown by default (so they only show after I assigned a callback), if possible.
Then I dynamically assign the callbacks to each binding from code, till I run out of bindings or things to assign.
|
How about this? You assign each keybinding a callback function, say, MyCallbacks.Keybind1() through 5(). In LUA code, you first define them to be empty functions:
Lua Code:
function MyCallbacks.Keybind1() end
Later, you can re-define the functions, because lua treats functions like just another variable:
Lua Code:
MyCallbacks["Keybind1"] = function() d("Hello World!") end
Does this seem like it would work?