I'm playing around a bit with global hot keys in Carbon, and I registered a hot key. When the hot key is pressed, this function is called:
OSStatus myHotKeyHandler(EventHandlerCallRef nextHandler, EventRef anEvent, void *userData) {
...
}
This function is in the same file as my app delegate's definition. How do I now call an ObjC method on my delegate in that function?
[self aMethod];
I cant add a void* (to be a pointer to my class instance) to the C function, because I am not the one calling it.
I tried to convert the method into a class method and then call it with [AppDelegate aFunction], which works but then I cant use my instance variables!