Play/Pause, rew/ff keys ...

2008-11-11 Thread I. Savant
List: Does anyone have experience intercepting the play/pause and rew/ff (seek back / seek forward) keys on some keyboards? Particularly, the MacBook / MacBook Pro keyboards? These keys control iTunes and QuickTime just fine when they're running but I'd like to intercept them myself

Re: Play/Pause, rew/ff keys ...

2008-11-11 Thread Dave DeLong
I would also like to know this. I tried fiddling around with an as- low-as-I-could-go CGEventTap a while ago to try and intercept them, but they never showed up in the callback. Ditto on the volume and eject keys. I think these buttons may work on the same principle as secure

Re: Play/Pause, rew/ff keys ...

2008-11-11 Thread I. Savant
On Nov 11, 2008, at 12:01 PM, Bill Monk wrote: This worked for me: http://www.rogueamoeba.com/utm/archives/MediaKeys.m Thanks, Bill, it looks promising. I was worried about the need for being multiple-keyboard-layout-aware but if the keys are merely defines in a header, it's probably

Re: Play/Pause, rew/ff keys ...

2008-11-11 Thread I. Savant
On Nov 11, 2008, at 12:35 PM, Kevin Gessner wrote: I can give y'all some code if you're needing. Sure, the more the merrier! :-) -- I.S. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator

Re: Play/Pause, rew/ff keys ...

2008-11-11 Thread Peter Maurer
So I was hoping someone else had figured this out. :-) A quick look at this list's archive reveals this post ... http://lists.apple.com/archives/cocoa-dev/2007/Aug/msg00499.html ... by yours truly, which was later followed by Rogue Amoeba's aforementioned take on this. Look here for the

Re: Play/Pause, rew/ff keys ...

2008-11-11 Thread I. Savant
On Nov 11, 2008, at 1:40 PM, Peter Maurer wrote: So I was hoping someone else had figured this out. :-) A quick look at this list's archive reveals this post ... http://lists.apple.com/archives/cocoa-dev/2007/Aug/msg00499.html ... by yours truly, which was later followed by Rogue Amoeba's

Re: Play/Pause, rew/ff keys ...

2008-11-11 Thread Ben Lachman
I noodled around with this for SousChef, and it's fairly straight forward to get the events (I can provide code if desired). However the problem I ran into was that I couldn't stop the events from also going to iTunes like the QT player does. So its not too helpful since a person using

Re: Play/Pause, rew/ff keys ...

2008-11-11 Thread I. Savant
On Nov 11, 2008, at 10:27 AM, Dave DeLong wrote: I would also like to know this. I tried fiddling around with an as- low-as-I-could-go CGEventTap a while ago to try and intercept them, but they never showed up in the callback. Ditto on the volume and eject keys. I haven't gone that

Re: Play/Pause, rew/ff keys ...

2008-11-11 Thread Kevin Gessner
An application of mine, FunctionFlip, does just this - it eats special key presses. I use a CGEventTap at kCGSessionEventTap. To get system events, you have to tell the tap to listen to NX_SYSDEFINED events. Then, if you want to stop the event, just return null from your callback. I can

Re: Play/Pause, rew/ff keys ...

2008-11-11 Thread Kevin Gessner
The pertinent methods, from my app's delegate. It listens for both regular and special key presses, so modify accordingly. CGEventRef myCGEventCallback(CGEventTapProxy proxy, CGEventType type, CGEventRef event, void *refcon) { // Paranoid sanity check. if ((type !=