• 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: Writing a preference pane that configures hotkeys?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Writing a preference pane that configures hotkeys?


  • Subject: Re: Writing a preference pane that configures hotkeys?
  • From: "Brian Kendall" <email@hidden>
  • Date: Mon, 24 Mar 2008 01:47:57 -0400


Sorry - perhaps I wasn't clear enough.

This is a preference pane for a background application, which actually
registers the hot key with the system.  The preference pane just needs to
have some kind of button or text field so that the user can input *which*
hotkey they want the background app to use.  Unfortunately, that requires
lower level access to what keys are being pressed than I know how to get
in a preference pane.

I could use an event tap, but that seems like it's way too low level, and
I suspect that there must be an easier, more cocoa friendly way.  All I
need is for the pref pane to be able to intercept one keystroke, complete
with modifier keys, like in the Keyboard & Mouse pref pane, though it
doesn't necessarily have to work the same way.  I've seen other 3rd party
preference panes record keystrokes for hotkeys after pressing a button, so
obviously it's possible.  I just don't know quite how.

- Brian


On Sun, 23 Mar 2008 22:34:16 -0400, Andrew Farmer <email@hidden> wrote:

On 23 Mar 08, at 19:26, Brian Kendall wrote:
I'm trying to write a preference pane that allows the user to specify a hotkey. Ordinarily I would override sendEvent in NSApplication, but since it's a preference pane that's not possible in this case since the System Preferences application is already instantiated. Obviously this is possible, since many other preference panes do this, including the Keyboard & Mouse pref pane. What's the propper way to go about doing this?

Create a helper app that runs in the background. Preference panes only "exist" while they're open, so registering a hotkey there doesn't do you much good.
_______________________________________________

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: Writing a preference pane that configures hotkeys?
      • From: "Rob Napier" <email@hidden>
References: 
 >Writing a preference pane that configures hotkeys? (From: "Brian Kendall" <email@hidden>)
 >Re: Writing a preference pane that configures hotkeys? (From: Andrew Farmer <email@hidden>)

  • Prev by Date: Re: How do I disable this warning: "local declaration of 'varname' hides instance variable"
  • Next by Date: Re: Writing a preference pane that configures hotkeys?
  • Previous by thread: Re: Writing a preference pane that configures hotkeys?
  • Next by thread: Re: Writing a preference pane that configures hotkeys?
  • Index(es):
    • Date
    • Thread