What I was hoping to do was following:
Code: Select all
InstallEventHandler({onkeydown = Function() DebugPrint("test") EndFunction})
InstallEventHandler({onkeydown = Function() DebugPrint("test2") EndFunction})
Is there any other way to achieve this, except by coding it myself in way of that I refer onkeydown to go to a function which takes care that all my "onkeydown" events are being executed?
I mean, I could do something like:
Code: Select all
InstallEventHandler({onkeydown = onkeydownfuncs
function onkeydownfuncs()
foreach(onkeydownfuncslist, function (id, func)
func()
endfunction
For example it could be handy if each InstalEventHandler would return an ID, and then I could later on use to remove those InstallEventHandlers by using that ID, this way I could use for example:
Code: Select all
ID1 = InstallEventHandler({onkeydown = Function() DebugPrint("test") EndFunction})
ID2 = InstallEventHandler({onkeydown = Function() DebugPrint("test2") EndFunction})
Code: Select all
RemoveEventHandler(ID2)