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 give y'all some code if you're needing.
HTH,
-- Kevin
Kevin Gessner
http://www.kevingessner.com
[EMAIL PROTECTED]
On Nov 11, 2008, at 12:10 PM, Ben Lachman wrote:
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 SousChef hits ffwd and SousChef would advance
to the next step, however iTunes would also advance to the next
song. Has anyone had any luck eating these events as they come in?
->Ben
--
Ben Lachman
Acacia Tree Software
http://acaciatreesoftware.com
email: [EMAIL PROTECTED]
twitter: @benlachman
mobile: 740.590.0009
On Nov 11, 2008, at 12:01 PM, Bill Monk wrote:
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?
This worked for me:
http://www.rogueamoeba.com/utm/archives/MediaKeys.m
Basically, subclass NSApplication, override -sendEvent:, and look
for the special keys you want, as defined in
<IOKit/hidsystem/ev_keymap.h>. They include play/pause/stop, volume
up/down, screen brightness up/dow, etc.
_______________________________________________
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/blachman%40mac.com
This email sent to [EMAIL PROTECTED]
_______________________________________________
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/kevin%40kevingessner.com
This email sent to [EMAIL PROTECTED]
_______________________________________________
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 [EMAIL PROTECTED]