Go Back   The macosxhints Forums > OS X Help Requests > System



Reply
 
Thread Tools Rating: Thread Rating: 15 votes, 5.00 average. Display Modes
Old 11-09-2010, 08:37 PM   #1
fracai
MVP
 
Join Date: May 2004
Posts: 2,099
Documenting com.apple.symbolichotkeys.plist

Many previous hints have focused on modifying keyboard shortcuts directly through the preference files. One that always comes up in the comments is the search to modify the Dictionary mouse over keys. I've been baffled by this for a while because it's supposed to be Command-Control-D, but mine is Command-Shift-E. I eventually figured out that I must have changed it under Tiger or Leopard, when the shortcut was listed in System Preferences and it's persisted ever since even though you can no longer change the keys.

Yesterday I set out to figure out which prefs file controlled this. I narrowed in on ~/Library/Preferences/com.apple.symbolichotkeys.plist. And, by systematically enabling and disabling the shortcuts under "System Preferences>Keyboard>Keyboard Shortcuts", I was able to identify key id which controls the Dictionary mouse over (70).

I've documented as many as I could below. I'd appreciate it if anyone could fill in any others. The process I used was to make a copy of my current settings [1], make a change to one of the shortcuts, compare the current settings to the stored copy [2], change back the shortcut, and try another.

Code:
[1] defaults read com.apple.symbolichotkeys > current.txt
Code:
[2] defaults read com.apple.symbolichotkeys | diff current.txt -
You might need some context with the diff command (diff -C 1 or diff -C 5) in order to see the shortcut ID. Or use 'twdiff' from TextWrangler to get a visual diff that might be easier to work with. In that case, make a copy of the original com.apple.symbolichotkeys.plist file and use:
Code:
twdiff copy.plist ~/Library/Preferences/com.apple.symbolichotkeys.plist
More information on how to set these keys is available in this hint. Always keep a backup.
A few other key codes are indicated here. Generally, the presence of 65535 seems to indicate a function key. If the first parameter value isn't 65535, the second value is the key code for the shortcut key. The first parameter is the ASCII value of that key code. This seems to get a bit complicated if you use a non-US keyboard layout.
Full Key Codes is quite a bit of help when looking at keycodes.

The listings below indicate the shortcut number, meaning, and what my preferences are set as. Yours will probably be different in some cases.

Quote:
131072: Shift
262144: Control
524288: Option
1048576: Command

Add modifier values together in the 3rd parameter to combine them.

{ AppleSymbolicHotKeys = {

# Move focus to the menu bar - Control, F2
7 = { enabled = 1; value = { parameters = ( 65535, 120, 262144 ); type = standard; }; };

# Move focus to the Dock - Control, F3
8 = { enabled = 1; value = { parameters = ( 65535, 99, 262144 ); type = standard; }; };

# Move focus to active or next window - Control, F4
9 = { enabled = 1; value = { parameters = ( 65535, 118, 262144 ); type = standard; }; };

# Move focus to window toolbar - Control, F5
10 = { enabled = 1; value = { parameters = ( 65535, 96, 262144 ); type = standard; }; };

# Move focus to floating window - Control, F6
11 = { enabled = 1; value = { parameters = ( 65535, 97, 262144 ); type = standard; }; };

# ??? - Control, F1
12 = { enabled = 1; value = { parameters = ( 65535, 122, 262144 ); type = standard; }; };

# Change the way Tab moves focus - Control, F7
13 = { enabled = 1; value = { parameters = ( 65535, 98, 262144 ); type = standard; }; };

# Turn zoom on or off - Command, Option, 8
15 = { enabled = 1; value = { parameters = ( 56, 28, 1572864 ); type = standard; }; };

# Zoom in - Command, Option, =
17 = { enabled = 0; value = { parameters = ( 61, 24, 1572864 ); type = standard; }; };

# Zoom out - Command, Option, -
19 = { enabled = 0; value = { parameters = ( 45, 27, 1572864 ); type = standard; }; };

# Reverse Black and White - Command, Control, Option, 8
21 = { enabled = 1; value = { parameters = ( 56, 28, 1835008 ); type = standard; }; };

# Turn image smoothing on or off - Command, Option, \
23 = { enabled = 0; value = { parameters = ( 92, 42, 1572864 ); type = standard; }; };

# Increase Contrast - Command, Control, Option, .
25 = { enabled = 1; value = { parameters = ( 46, 47, 1835008 ); type = standard; }; };

# Decrease Contrast - Command, Control, Option, ','
26 = { enabled = 1; value = { parameters = ( 44, 43, 1835008 ); type = standard; }; };

# Move focus to the next window in application - Command, backtic
27 = { enabled = 1; value = { parameters = ( 96, 50, 1048576 ); type = standard; }; };

# Save picture of screen as file - Command, Shift, 3
28 = { enabled = 1; value = { parameters = ( 51, 20, 1179648 ); type = standard; }; };

# Copy picture of screen to clipboard - Command, Control, Shift, 3
29 = { enabled = 1; value = { parameters = ( 51, 20, 1441792 ); type = standard; }; };

# Save picture of selected area as file - Command, Shift, 4
30 = { enabled = 1; value = { parameters = ( 52, 21, 1179648 ); type = standard; }; };

# Copy picture of selected area to clipboard - Command, Control, Shift, 4
31 = { enabled = 1; value = { parameters = ( 52, 21, 1441792 ); type = standard; }; };

# All Windows - F9
32 = { enabled = 1; value = { parameters = ( 65535, 101, 0 ); type = standard; }; };

# Application Windows - F10
33 = { enabled = 1; value = { parameters = ( 65535, 109, 0 ); type = standard; }; };

# All Windows (Slow) - F9
34 = { enabled = 1; value = { parameters = ( 65535, 101, 131072 ); type = standard; }; };

# Application Windows (Slow) - F10
35 = { enabled = 1; value = { parameters = ( 65535, 109, 131072 ); type = standard; }; };

# Desktop - F11
36 = { enabled = 1; value = { parameters = ( 65535, 103, 0 ); type = standard; }; };

# Desktop (Slow) - F11
37 = { enabled = 1; value = { parameters = ( 65535, 103, 131072 ); type = standard; }; };

# ??? - Command, Option, T
50 = { enabled = 1; value = { parameters = ( 116, 17, 1572864 ); type = standard; }; };

# Move focus to the window drawer - Command, Option, quote
51 = { enabled = 1; value = { parameters = ( 39, 50, 1572864 ); type = standard; }; };

# Turn Dock Hiding On/Off - Command, Option, D
52 = { enabled = 1; value = { parameters = ( 100, 2, 1572864 ); type = standard; }; };

# ??? - F14
53 = { enabled = 1; value = { parameters = ( 65535, 107, 0 ); type = standard; }; };

# ??? - F15
54 = { enabled = 1; value = { parameters = ( 65535, 113, 0 ); type = standard; }; };

# ??? - Option, F14
55 = { enabled = 1; value = { parameters = ( 65535, 107, 524288 ); type = standard; }; };

# ??? - Option, F15
56 = { enabled = 1; value = { parameters = ( 65535, 113, 524288 ); type = standard; }; };

# Move focus to the status menus - Control, F8
57 = { enabled = 1; value = { parameters = ( 65535, 100, 262144 ); type = standard; }; };

# Turn VoiceOver on / off - Command, F5
59 = { enabled = 1; value = { parameters = ( 65535, 96, 1048576 ); type = standard; }; };

# Select the previous input source - Command, Option, Space
60 = { enabled = 1; value = { parameters = ( 32, 49, 1572864 ); type = standard; }; };

# Select the next source in the Input Menu - Command, Option, Shift, Space
61 = { enabled = 1; value = { parameters = ( 32, 49, 1703936 ); type = standard; }; };

# Dashboard - F12
62 = { enabled = 1; value = { parameters = ( 65535, 111, 0 ); type = standard; }; };

# Dashboard (Slow) - F12
63 = { enabled = 1; value = { parameters = ( 65535, 111, 131072 ); type = standard; }; };

# Show Spotlight search field - Command, Shift, Space
64 = { enabled = 1; value = { parameters = ( 65535, 49, 1179648 ); type = standard; }; };

# Show Spotlight window - Control, Shift, Space
65 = { enabled = 1; value = { parameters = ( 65535, 49, 393216 ); type = standard; }; };

# Dictionary MouseOver - Command, Shift, E
70 = { enabled = 1; value = { parameters = ( 101, 2, 1179648 ); type = standard; }; };

# Hide and show Front Row - Command, Esc
73 = { enabled = 1; value = { parameters = ( 65535, 53, 1048576 ); type = standard; }; };

# Activate Spaces - F8
75 = { enabled = 1; value = { parameters = ( 65535, 100, 0 ); type = standard; }; };

# Activate Spaces (Slow) - Shift, F8
76 = { enabled = 1; value = { parameters = ( 65535, 100, 131072 ); type = standard; }; };

# Spaces Left - Control, Left
79 = { enabled = 1; value = { parameters = ( 65535, 123, 262144 ); type = standard; }; };

# Spaces Right - Control, Right
81 = { enabled = 1; value = { parameters = ( 65535, 124, 262144 ); type = standard; }; };

# Spaces Down - Control, Down
83 = { enabled = 1; value = { parameters = ( 65535, 125, 262144 ); type = standard; }; };

# Spaces Up - Control, Up
85 = { enabled = 1; value = { parameters = ( 65535, 126, 262144 ); type = standard; }; };

# Show Help Menu - Command, Shift, /
91 = { enabled = 0; };
92 = { enabled = 0; };
98 = { enabled = 0; value = { parameters = ( 47, 44, 1179648 ); type = standard; }; };

# Switch to Space 1 - Control, 1
118 = { enabled = 1; value = { parameters = ( 65535, 18, 262144 ); type = standard; }; };

# Switch to Space 2 - Control, 2
119 = { enabled = 1; value = { parameters = ( 65535, 19, 262144 ); type = standard; }; };

# Switch to Space 3 - Control, 3
120 = { enabled = 1; value = { parameters = ( 65535, 20, 262144 ); type = standard; }; };

# Switch to Space 4 - Control, 4
121 = { enabled = 1; value = { parameters = ( 65535, 21, 262144 ); type = standard; }; };

122 = { enabled = 0; };
123 = { enabled = 0; };
124 = { enabled = 0; };
125 = { enabled = 0; };
126 = { enabled = 0; };
127 = { enabled = 0; };
128 = { enabled = 0; };
129 = { enabled = 0; };
130 = { enabled = 0; };
131 = { enabled = 0; };
132 = { enabled = 0; };
133 = { enabled = 0; };
134 = { enabled = 0; };
135 = { enabled = 0; };
136 = { enabled = 0; };
137 = { enabled = 0; };
138 = { enabled = 0; };
139 = { enabled = 0; };
140 = { enabled = 0; };
141 = { enabled = 0; };
142 = { enabled = 0; };
143 = { enabled = 0; };
144 = { enabled = 0; };
145 = { enabled = 0; };
146 = { enabled = 0; };
147 = { enabled = 0; };
148 = { enabled = 0; };
149 = { enabled = 0; };
}; }

whew
I hope this is helpful to someone.
fracai is offline   Reply With Quote
Old 11-10-2010, 12:16 AM   #2
tw
Hall of Famer
 
Join Date: Apr 2007
Posts: 4,262
Just for information's sake, the three parameters mean the following (as best I can tell)
  • parameter 1: ASCII code of the character (or 65535 - hex 0xFFFF - for non-ASCII characters).
  • parameter 2: the keyboard key code for the character.
  • Parameter 3: the sum of the control, command, shift and option keys. these are bits 17-20 in binary: shift is bit 17, control is bit 18, option is bit 19, and command is bit 20.
Application-specific keyboard shortcuts seem to be listed in the plist file for the particular application (you can get a list of applications with keyboard shortcuts by looking at the com.apple.custommenu.apps key of the com.apple.universalaccess.plist preference file. it would be reasonably easy to read and parse the symbolic hotkeys plist file using an applescript.
__________________
Philosophy is a battle against the bewitchment of our intelligence by means of language. -LW-
tw is offline   Reply With Quote
Old 01-05-2011, 03:18 AM   #3
SSSSSmokey
Guest
 
Posts: n/a
Thanks!

That was wonderfully helpful. Thank you sir.

If you are still interest in this issue, allow me to be helpful in return.

Download Full Key Codes 1.2:
http://softwares.bajram.com/utilities/#Full_Key_Codes

That will give you the ascii, dec, and hex values of whatever keys you press.

Download KeyRemap4Macbook. This amazing program gives you access at the very lowest levels to remap the keys how you want. Want to turn fn+escape into shift+command+option+control+9? Go right ahead.

Both programs are free and extremely useful.

I don't necessarily want to go figure out what each of those upper key combos (#122-149) is but I'll give you the info I can get without enabling and trying them out.

122-126 are Spaces shortcuts (control + non-numpad #'s)

Until 137 is the same, spaces with control but it uses the numpad instead.

That's as high as mine goes. Someone disappointing, I'd hoped to find something cool.
  Reply With Quote
Old 05-05-2011, 03:44 PM   #4
Sheik Yerbouty
Guest
 
Posts: n/a
You might like this unexpected one.
Cycle through applications with the middle mouse button, equivalent of command + tab.

#71 Cycle through active applications - middle mouse button
defaults write com.apple.symbolichotkeys AppleSymbolicHotKeys -dict-add 71 '{ enabled = 0; value = { parameters = ( 4, 4, 0 ); type = button; }; }'

As you see, 'type' is not always 'standard', like discribed in the second link, here.
  Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 02:43 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.