I've been looking thought the docs, but am unsure if what I would like to do is possible...
I would like a script file something like below, where SetCallback sets a call back function in response to a specific keycode, but specifying what script fn to call.
callBack1()
{
//gets called on esc. key down
}
main()
{
//stuff
SetCallback(callBack1, VK_ESC)
//stuff
}
then in my main kerenel, have a std::map setup something like:
+------------+----------+
| VK code | fn |
+-----------------------+
| VK_ESC | callBack1|
| ... | ... |
+-----------------------+
so I can do:
//can't remember what VK's come as
OnKeyDown(DWORD VK_CODE)
{
keyMap.Get(VK_CODE).second(); //calls the callBack1 in the script file.
}
Can this be done with angle script?