Skip navigation.
 
mlRe: Writing a preference pane that configures hotkeys?
FROM : Brian Kendall
DATE : Mon Mar 24 06:47:57 2008

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_removed>>
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.

Related mailsAuthorDate
mlWriting a preference pane that configures hotkeys? Brian Kendall Mar 24, 03:26
mlRe: Writing a preference pane that configures hotkeys? Andrew Farmer Mar 24, 03:34
mlRe: Writing a preference pane that configures hotkeys? Jens Alfke Mar 24, 06:46
mlRe: Writing a preference pane that configures hotkeys? Brian Kendall Mar 24, 06:47
mlRe: Writing a preference pane that configures hotkeys? Brian Kendall Mar 24, 06:49
mlRe: Writing a preference pane that configures hotkeys? Rob Napier Mar 24, 20:07
mlRe: Writing a preference pane that configures hotkeys? Brian Kendall Mar 25, 14:38
mlRe: Writing a preference pane that configures hotkeys? Nathan Day Mar 26, 14:56
mlRe: Writing a preference pane that configures hotkeys? Brian Kendall Mar 27, 07:18
mlRe: Writing a preference pane that configures hotkeys? Nathan Day Mar 27, 08:21
mlRe: Writing a preference pane that configures hotkeys? Brian Kendall Mar 27, 15:24