Re: getting an EventRecord?
Re: getting an EventRecord?
- Subject: Re: getting an EventRecord?
- From: Eric Schlegel <email@hidden>
- Date: Thu, 1 May 2003 08:15:57 -0700
On Thursday, May 1, 2003, at 01:16 AM, Matt Pease wrote:
Hi Marcel & all --
I need the event because the fxn I'm calling in my library needs
the event. It was written during the days of events & polling & such.
Does the documentation to your library specify that it only needs null
events, or does it actually need user-input events too?
Anyone know a way to get an EventRecord directly in Cocoa?
There isn't any way. You would have to create the EventRecord contents
yourself, possibly based on the contents of the current NSEvent.
Seems like these are my options?
* use WaitNextEvent to get it directly.
That won't work. You'll pull events from the queue that should be
handled by the host application.
* override sendEvent or call currentEvent & get a NSEvent. But
what is
the best way to convert an NSEvent into a EventRecord?
To convert an NSEvent to an EventRecord, you would just read the
relevant info from the NSEvent, convert it into the appropriate format
for an EventRecord (convert time in seconds to time in ticks, for
example), and fill in the fields of the EventRecord.
-eric
_______________________________________________
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.