Re: Trouble with event taps...

2009-08-11 Thread Nat Burke
Hey all, Ok, I have figured it out. Running as root did the trick. After this worked, I wondered if I had left the enable assistive devices checkbox off from a prior experiment, and behold it was off! My bad on that (and I even said it was on in my original post). I went back and read the

Re: Trouble with event taps...

2009-08-10 Thread Dave Keck
> >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. Woops, I forgot that you said you enabled access for assistive device. I just made a quick test project an

Re: Trouble with event taps...

2009-08-10 Thread Dave Keck
> 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 CFMachPortCreateRunLoopS

Re: Trouble with event taps...

2009-08-10 Thread Rob Keniger
On 11/08/2009, at 2:37 AM, James W. Walker wrote: I compared your code to the code that I use that gets key down successfully. One difference is that I don't immediately CFRelease the event tap and source, I keep them around as long as I use the tap. Another is that the first 2 parameter

Re: Trouble with event taps...

2009-08-10 Thread Nat Burke
Thanks all for some tips. I'm going to try the following ideas and I'll let you know how it goes: - Run as root - Try just trapping on keyboard events - Append my event tap to the tail, and try annotated. On Mon, Aug 10, 2009 at 9:37 AM, James W. Walker wrote: > > On Aug 9, 2009, at 3:15 PM,

Re: Trouble with event taps...

2009-08-10 Thread James W. Walker
On Aug 9, 2009, at 3:15 PM, Nat Burke wrote: I have posted my event tap creation code below - I've searched all over the mailing list and the net to see if I could find a solution, but I am genuinely stuck. Any help is greatly appreciated! // Create an event tap. eventMask = CGEvent

Re: Trouble with event taps...

2009-08-10 Thread Dave Keck
> also show that no bits in the eventMask are cleared away.  Also, I do have > 'Enable Assistive Devices' checked (or else I wouldn't even get the mouse > events I'd imagine), so I don't think thats the problem. I seem to remember a discrepancy between the documentation on event taps, and what act

Trouble with event taps...

2009-08-09 Thread Nat Burke
Hi all, I'm having some difficulty with event taps. I am creating my event tap from the 'awakeFromNib' function for my overloaded NSWindow. The problem is that keyUp and keyDown events are never trapped in my callback. I can see all the mouse events, and even the modifier keys (shift, optio