• 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: Play/Pause, rew/ff keys ...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Play/Pause, rew/ff keys ...
      • From: "I. Savant" <email@hidden>
References: 
 >Re: Play/Pause, rew/ff keys ... (From: Bill Monk <email@hidden>)
 >Re: Play/Pause, rew/ff keys ... (From: Ben Lachman <email@hidden>)

  • Prev by Date: Re: Any way to detect firstResponder changes?
  • Next by Date: REĀ : Any way to detect firstResponder changes?
  • Previous by thread: Re: Play/Pause, rew/ff keys ...
  • Next by thread: Re: Play/Pause, rew/ff keys ...
  • Index(es):
    • Date
    • Thread