I decided it was best to generalize my plugin so that it just sent keyboard events to Lua. This way programmers gets to interpret the events however they want.@Caroline
, you mentioned you had to print the stack to see what was going on. I have this stackDump() function that I got from PIL, but it only prints types. Do you have anything better?
I've got it all working except my event dispatching isn't working. I've read the Ultimate Guide on plugins. I've read some of the Programing In Lua book sections on C. Can anyone help me figure out what I've done wrong?
, you mentioned in my thread on the iCadePlugin that I needed to put dispatchEvent inside of the C++ class. I actually got the idea to put eventDispatch at the top from storeKit.mm. And from what I understand, it should work. Although I don't understand why one needs a class that inherits from GEventDispatcherProxy, so I could totally be wrong.
I did do a little goofing around and in my Lua file I redefined Event.new() and put an io.write() command in it and it runs, so I know I'm creating a new event in my dispatchEvent function. And I believe lua_pcall() is even executing successfully.
I'm on my iPad so I can't upload a file, and it wont let me post the full code in one message, so I'll split this over a few posts.
Edited to remove the code. See it in the attachment below.