Re: Trouble with event taps...
Re: Trouble with event taps...
- Subject: Re: Trouble with event taps...
- From: Dave Keck <email@hidden>
- Date: Mon, 10 Aug 2009 15:19:00 -1000
> James is exactly right, you're releasing the Event Tap before you enable
it.
> You should not release the event tap if you want to use it, it needs to
hang
> around for as long as you need it.
It's not mentioned in the docs, but the CFRunLoopSource created by the call
to CFMachPortCreateRunLoopSource() retains the CFMachPort object. And since
Nat's callback is called for mouse events but not keyboard events, the fact
that he's releasing the CFMachPort object early doesn't explain why he's not
receiving the keyboard events.
And naturally, just now, I noticed it mentioned in the docs:
Event taps receive key up and key down events if one of the following
conditions is true: The current process is running as the root user. Access
for assistive devices is enabled.
Three strikes for relying on the docs in the header and not bothering to
check the 'real' docs. Case closed?
_______________________________________________
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