AppleSymbolicHotKeys plist dict中的参数值代表什么? [英] what do the parameter values in AppleSymbolicHotKeys plist dict represent?
问题描述
tl; dr
com.apple.symbolichotkeys:AppleSymbolicHotKeys
中的第一个parameters
值代表什么?
详细信息...
AppleSymbolicHotKeys结构
位于以下位置的OS X符号热键plist文件
~/Library/Preferences/com.apple.symbolichotkeys.plist
将热键存储在名为"AppleSymbolicHotKeys"的字典中,其条目类似于
<action:int> = Dict {
enabled = <enabled:bool>
value = Dict {
type = <type:string>
parameters = Array {
<param_1:int>
<param_2:int>
<param_3:int>
}
}
}
示例:
10 = Dict {
enabled = true
value = Dict {
type = standard
parameters = Array {
56
28
1572864
}
}
}
专业提示:您可以使用
/usr/libexec/PlistBuddy -c "Print :AppleSymbolicHotKeys" ~/Library/Preferences/com.apple.symbolichotkeys.plist
值
action:int
这是热键将执行的操作的ID.网上有相当完整的列表,请进行谷歌搜索,因为我没有足够的积分来发布链接或其他内容.
enabled:bool
是否启用了热键.
type:string
似乎总是标准".
param_1:int
这是我无法获得的.它似乎不一定与参数2和3有关,尽管当其他参数更改时它通常也会更改.例如...
我可以在System Preferences -> Keyboard -> Shortcuts -> Mission Control
视图中单击Restore Defaults
,它将切换到桌面1"设置为"ctrl + 1".读取该操作的值(数字118),我看到param_1
设置为65535
.如果在UI中手动将组合键设置为"ctrl + 1",则将param_1
设置为49
. param_2
和param_3
的值始终保持不变.
param_2:int
这似乎是
的关键代码/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/Headers/Events.h
用于按下非修饰键,但值65535
在param_1
中非常常见,并且在本地计算机上的param_2
中显示,用于操作160、163和175. /p>
param_3:int
似乎指示要按下的修改键,根据
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",
}
您会注意到代表多个修饰符的数字是它们代表的修饰符的总和,例如
"Shift + Control" = 393216 = 131072 + 262144 = "Shift" + "Control"
所以...
任何见解将不胜感激,并希望这可以作为我向其他接近该主题的人挖掘的信息的参考.
它是键上字母的ASCII码,如果没有ASCII码,则为-1(65535).请注意,字母是小写字母,因此D为100(小写字母d).
有时,通常具有ascii码的键使用65535代替.当使用控制键修饰符(例如与特定空间的热键)一起使用时,似乎会发生这种情况.
这里有一个不错的2011年键和值列表,以及一些其他详细信息:
http://hintsforums.macworld.com/showthread.php?t=114785
tl;dr
what does the first parameters
value in com.apple.symbolichotkeys:AppleSymbolicHotKeys
represent?
details...
the AppleSymbolicHotKeys structure
the OS X symbolic hotkeys plist file at
~/Library/Preferences/com.apple.symbolichotkeys.plist
stores hotkeys in a dict called as '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 with
/usr/libexec/PlistBuddy -c "Print :AppleSymbolicHotKeys" ~/Library/Preferences/com.apple.symbolichotkeys.plist
the values
action:int
this is the id of the action the hotkey will take. there are reasonably complete lists around the net, do some googling 'cause i don't have enough points to post links or whatever.
enabled:bool
whether the hotkey is enabled.
type:string
always seems to be 'standard'.
param_1:int
this is the one i can't get. it doesn't seem necessarily connected to params 2 and 3, though it often changes when the other params are changed. for instance...
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 that action (number 118), i see that param_1
is set to 65535
. if i manually set the key combo to "ctrl + 1" in the UI, i get param_1
set to 49
. the values of param_2
and param_3
stay the same throughout.
param_2:int
this seems to be key codes from
/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/Headers/Events.h
for the non-modifier key to be pressed, except for the value 65535
, which is very common in param_1
, and shows up in param_2
on my local machine for actions 160, 163 and 175.
param_3:int
seems to indicate the modifier key to be depressed, as according to
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 the numbers representing multiple modifiers are the sum of the modifiers they represent, e.g.
"Shift + Control" = 393216 = 131072 + 262144 = "Shift" + "Control"
so...
any insight would be greatly appreciated, and hope this can serve as a reference for the info i dug up to anyone else approaching the subject.
It is the ascii code of the letter on the key, or -1 (65535) if there is no ascii code. Note that letters are lowercase, so D is 100 (lowercase d).
Sometimes a key that would normally have an ascii code uses 65535 instead. This appears to happen when the control key modifier is used, for example with hot keys for specific spaces.
There is a nice list of keys and values from 2011 here, along with some other good details:
http://hintsforums.macworld.com/showthread.php?t=114785
这篇关于AppleSymbolicHotKeys plist dict中的参数值代表什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!