Code: Select all
InstallEventHandler({OnKeyDown = Function(msg) Self:HandleOnKeyDown(msg) EndFunction})
However, I am having one problem with the function that I am not sure what is the root reason or how to fix it.
Thing is, I have something like:
Code: Select all
function OOP:HandleOnKeyDown(msg)
debugprint(self.myvariable)
endfunction
For at start I set this myvariable to "none" and then elsewhere in code I do:
Code: Select all
self.myvariable = "something"
As far as I have understood, this system I am using on InstallEventHandler should make it to call the function dynamically, but based upon it not working as expected, is it then saving it somehow into its current state and hence it keeps thinking that myvariable is "none" instead of "something"?