Getting Carbon EventRef from cocoa NSEvent
Getting Carbon EventRef from cocoa NSEvent
- Subject: Getting Carbon EventRef from cocoa NSEvent
- From: Rangaswamy C T <email@hidden>
- Date: Fri, 24 Oct 2008 03:12:10 +0530
- Acceptlanguage: en-US
- Thread-topic: Getting Carbon EventRef from cocoa NSEvent
Hi All,
For some requirement in my product, I have embedded my Carbon window inside Cocoa window using addChildWindow method.
For getting my carbon window UI (keyboard and mouse) events working, I had to watch cocoa events for NSWindow of Carbon window and then redispatch carbon eventRef's to Carbon window using SendEventToEventTarget API.
So while converting Cocoa event to carbon events, I used the following piece of code
- (void)keyDown:(NSEvent *)theEvent
{
OSStatus status; //1
EventRef carbonEvnt; //2
carbonEvnt = (EventRef) [theEvent eventRef]; //3
}
But the above NSEvent method eventRef is crashing (at 3) on Tiger. But on Leopard it works fine.
Am I doing anything wrong here?
Thanks
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden