carbon events in cocoa app...
carbon events in cocoa app...
- Subject: carbon events in cocoa app...
- From: Philip George <email@hidden>
- Date: Sat, 7 Dec 2002 05:37:29 -0600
I have a Cocoa app that i need to not only process NSEvents, but I am
also interested in Carbon events. The following code seems to work,
but gets stuck on the last line ( 'RunApplicationEventLoop();' ). Why?
(NOTE!!! : For the sake of clarity, the following snippet will NOT
refer to the actual event I'm interested in. Instead I use a basic,
familiar event : mouse down (or in the case of Carbon,
kEventMouseDown). Please do not reply only to tell me that I should
use mouseDown: . The actual Carbon event I'm interested in is
completely different. All I want is to know how to register for
**some/any Carbon event inside a Cocoa app, while still dealing with
NSEvents as well.)
////////////////////////////////////////// in app startup code...
EventTypeSpec appEventList[] = {
{kEventClassMouse, kEventMouseDown}
};
InstallApplicationEventHandler(NewEventHandlerUPP(MyAppEventHandler),
1, appEventList, 0, NULL);
RunApplicationEventLoop(); // this is where i get stuck
////////////////////////////////////////// the handler function...
static pascal OSStatus MyAppEventHandler (EventHandlerCallRef
myHandlerChain, EventRef event, void* userData) {
OSStatus result = noErr;
printf("inside handler!!\n"); // not only am i stuck in the event
loop, but the
// handler never gets called, so this line never prints.
return result;
}
Thanks.
- Philip
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.