• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Trouble with event taps...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Trouble with event taps...
      • From: Dave Keck <email@hidden>
References: 
 >Trouble with event taps... (From: Nat Burke <email@hidden>)
 >Re: Trouble with event taps... (From: "James W. Walker" <email@hidden>)
 >Re: Trouble with event taps... (From: Rob Keniger <email@hidden>)

  • Prev by Date: Re: Trouble with event taps...
  • Next by Date: Re: Trouble with event taps...
  • Previous by thread: Re: Trouble with event taps...
  • Next by thread: Re: Trouble with event taps...
  • Index(es):
    • Date
    • Thread