• 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: Global hotkeys
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Global hotkeys


  • Subject: Re: Global hotkeys
  • From: "M. Uli Kusterer" <email@hidden>
  • Date: Thu, 16 Sep 2004 13:59:32 +0200

At 21:12 Uhr -0700 15.09.2004, Daniel Jalkut wrote:
Don, you probably want to use the Carbon HotKey API. There may be an Obj-C wrapper out there somewhere, but it shouldn't be too hard to write one yourself.

Well, the key entry field can be pretty annoying to implement (i.e. the one where the user enters their hotkey). There is a collection of classes called CocoaHotKeys3 (PTHotKey and company) that are pretty nice Cocoa wrappers around all of this. Maybe you can track them down. They're by Quentin Carnicelli, but the link I had doesn't work anymore. I may have a copy floating around somewhere, but I'm not sure whether I modified it...


The biggest obstacle for non-Carbon programmers will be getting the concept of installing a Carbon Event callback down. Search the Apple documentation for "RegisterEventHotKey".

Actually, the bigger obstacle is turning the virtual key codes this API takes back into the actual character names for your edit field. If you're rolling your own, I'd suggest you just save the character for that key *and* the key code to your prefs. Will save you some work. Carbon Events are simply a procedural API with some quirks.
--
Cheers,
M. Uli Kusterer
------------------------------------------------------------
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
  • Follow-Ups:
    • Re: Global hotkeys
      • From: Daniel Jalkut <email@hidden>
References: 
 >Global hotkeys (From: Don Smith <email@hidden>)
 >Re: Global hotkeys (From: Daniel Jalkut <email@hidden>)

  • Prev by Date: Re: modifying self in init
  • Next by Date: Re: build numbers
  • Previous by thread: Re: Global hotkeys
  • Next by thread: Re: Global hotkeys
  • Index(es):
    • Date
    • Thread