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

Re: Repeating Hotkeys


  • Subject: Re: Repeating Hotkeys
  • From: Daniel Jalkut <email@hidden>
  • Date: Tue, 5 Sep 2006 13:57:14 -0400

Hi Alex - I'm catching you on IRC I think, but I'll post this theory for the sake of the list, and hopefully somebody can chime in if they have a better idea.

In your position, I think I'd add to your existing Carbon event handler the request to receive kEventHotKeyReleased messages. Now, when you get a hot key pressed event, you can trigger the action and install a periodic timer. Whenever you get the timer, retrigger your action. When you get a hot key released message, uninstall the timer.

As long as the released events are as reliable as the pressed events, this should work well.

Daniel

On Sep 5, 2006, at 12:38 PM, Alexander Repty wrote:

Hello everyone,

I recently implemented global hotkeys in my application using Dustin Bachrach's fine tutorial: http://dbachrach.com/blog/2005/11/ program-global-hotkeys-in-cocoa-easily/

Everything works fine, but I have been trying to figure out how to detect if the user presses and holds the hotkey, so I can repeatedly invoke the corresponding method. Using my current solution, the user has to release and press the button over again if they want to repeat the action.

The documentation, Google and IRC did not come up with any worthwhile results on this issue, so I'm hoping that someone here has a clue for me. Many thanks in advance.

Cheers,
Alex
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
sweater.com


This email sent to email@hidden

_______________________________________________ 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
References: 
 >Repeating Hotkeys (From: Alexander Repty <email@hidden>)

  • Prev by Date: Re: Syntactic sugar
  • Next by Date: Re: strange situation with frameworks
  • Previous by thread: Repeating Hotkeys
  • Next by thread: Re: Repeating Hotkeys
  • Index(es):
    • Date
    • Thread