> 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 (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com