Global Hotkeys (was: expose hotkeys)
Global Hotkeys (was: expose hotkeys)
- Subject: Global Hotkeys (was: expose hotkeys)
- From: Hamish Allan <email@hidden>
- Date: Fri, 25 Nov 2005 21:58:28 +0000
On Fri, 25 Nov 2005 09:38:43 -0600, Ricky Sharp <email@hidden> wrote:
Unfortunately, for the case of reassigning a function key to my
expose prefs, the difference showed up under
'com.apple.symbolichotkeys' and its values do not seem to lend
themselves to easily find out what key does what:
36 = {enabled = 1; value = {parameters = (-1, 103, 0); type =
standard; }; };
37 = {enabled = 1; value = {parameters = (-1, 103, 131072); type =
standard; }; };
For me, under 10.4.3, the diff came up under
"com.apple.universalaccess", which looks like this:
"com.apple.universalaccess" = {
UserAssignableHotKeys = (
{enabled = 1; key = 20; modifier = 1179648;
sybmolichotkey[sic] = 28; },
{enabled = 1; key = 20; modifier = 1441792;
sybmolichotkey = 29; },
{enabled = 1; key = 21; modifier = 1179648;
sybmolichotkey = 30; },
[...]
It is sensible of Apple to ensure that their global hotkeys are
registered in some central location, which can provide warnings when
settings clash. But in order for this to be truly useful, we need
some way to access it as developers. As far as I can tell, there's no
Cocoa way to register hotkeys: you have to use the Carbon
RegisterEventHotKey(). However, this has nothing to do with the stuff
described above, and it seems that any hotkey registered through
RegisterEventHotKey() is overridden by the com.apple.universalaccess
settings.
I tried messing with /System/Library/PreferencePanes/
Keyboard.prefpane/Contents/Resouces/English.lproj/
DefaultConfigKeysTable.xml and I was able to get a new group in
System Preferences -> Keyboard & Mouse -> Keyboard Shortcuts with a
couple of new descriptions for new keyboard shortcuts. But I could
either give them the same identifiers as existing groups (e.g.,
"dashboard-expose") in which case they were bound to the same part of
the model (identifying a clash with another keyboard shortcut, but
trying to change one of them would change both) or I could give them
a different identifier, in which case it wouldn't let me change the
keyboard shortcut.
I was *really* hoping that the identifier (plus its associated
sybmolichotkey) would form the payload for a distributed notification
("com.apple.universalaccess.GlobalHotkeyNotification"). But this is
apparently not the case :(
Could it be mad to be so? Would there be any problem with this?
Does anyone know of any plans for Apple to open up any API? Or
perhaps there is one already and I'm missing it?!
Thanks,
Hamish
_______________________________________________
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