Re: Play/Pause, rew/ff keys ...
Re: Play/Pause, rew/ff keys ...
- Subject: Re: Play/Pause, rew/ff keys ...
- From: Kevin Gessner <email@hidden>
- Date: Tue, 11 Nov 2008 12:35:22 -0500
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@hidden
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@hidden
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 (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
_______________________________________________
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
_______________________________________________
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