What do parameter values โ€‹โ€‹in AppleSymbolicHotKeys plist dict represent?

TL; DR

What does the first parameters value in com.apple.symbolichotkeys:AppleSymbolicHotKeys ?

more details ...

AppleSymbolicHotKeys structure

OS X symbolic hotkeys file

 ~/Library/Preferences/com.apple.symbolichotkeys.plist 

stores shortcuts in a dict called "AppleSymbolicHotKeys", with entries that look like

 <action:int> = Dict { enabled = <enabled:bool> value = Dict { type = <type:string> parameters = Array { <param_1:int> <param_2:int> <param_3:int> } } } 

Example:

 10 = Dict { enabled = true value = Dict { type = standard parameters = Array { 56 28 1572864 } } } 

pro tip: you can take a look at

 /usr/libexec/PlistBuddy -c "Print :AppleSymbolicHotKeys" ~/Library/Preferences/com.apple.symbolichotkeys.plist 

values

action:int

this is the identifier of the action that the hotkey will take. there are quite complete lists on the net, some search queries, because I donโ€™t have enough points to publish links or something else.

enabled:bool

Is the hotkey enabled?

type:string

always seems "standard."

param_1:int

this is one that I canโ€™t get. it is not necessarily associated with parameters 2 and 3, although it often changes as other parameters change. eg...

I can click Restore Defaults in the System Preferences -> Keyboard -> Shortcuts -> Mission Control view, and it will set "Switch to desktop 1" to "ctrl + 1". reading the value for this action (number 118), I see that param_1 set to 65535 . if I manually set the key combination to "ctrl + 1" in the user interface, I set param_1 to 49 . the values โ€‹โ€‹of param_2 and param_3 remain unchanged.

param_2:int

these are apparently the key codes from

 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/Headers/Events.h 

to press the non-modifier key, except for the value 65535 , which is very often found in param_1 and displayed in param_2 on my local machine for actions 160, 163 and 175.

param_3:int

seems to indicate a modifier key press, as indicated in

 MODS = { 0=>"No modifier", 131072=>"Shift", 262144=>"Control", 524288=>"Option", 1048576=>"Command", 393216=>"Shift + Control", 655360=>"Shift + Option", 1179648=>"Shift + Command", 786432=>"Control + Option", 1310720=>"Control + Command", 1572864=>"Option + Command", 917504=>"Shift + Control + Option", 1441792=>"Shift + Control + Command", 1703936=>"Shift + Option + Command", 1835008=>"Control + Option + Command", 1966080=>"Shift + Control + Option + Command", } 

where you will notice that the numbers representing several modifiers are the sum of the modifiers that they represent, for example.

 "Shift + Control" = 393216 = 131072 + 262144 = "Shift" + "Control" 

So...

any understanding will be appreciated, and we hope that this can serve as background information for the information that I dug up to everyone who is relevant to the topic.

+7
hotkeys plist macos
source share
2 answers

This is the ascii code of the letter on the key, or -1 (65535) if there is no ascii code. Note that letters have lowercase letters, so D is 100 (lowercase d).

Sometimes a key, which usually has the ascii code, uses 65535 instead. This happens when a control key modifier is used, for example, using hotkeys for specific spaces.

Here is an excellent list of keys and values โ€‹โ€‹from 2011, as well as some other good details:

http://hintsforums.macworld.com/showthread.php?t=114785

+3
source share

The numerical values โ€‹โ€‹in the nrser answer make more sense when viewed in hexadecimal:

 0x000000 => "No modifier", 0x020000 => "Shift", 0x040000 => "Control", 0x080000 => "Option", 0x100000 => "Command", 

Others are just bit-wise ORs from the above values, for example:

 0x060000 => "Shift + Control", 0x180000 => "Command + Option", 
+2
source share

All Articles