The first step in disabling a system hotkey that’s not listed in Keyboard Shortcuts System Settings is to run defaults read com.apple.symbolichotkeys.plist | less
and find the relevant one.
Some filtering criteria that can be used are:
- The third
parameters
value are modifiers (eg ⌥, Fn, etc). Modifier values can be found in https://gist.github.com/stephancasas/74c4621e2492fb875f0f42778d432973 and https://github.com/phracker/MacOSX-SDKs/blob/master/MacOSX10.6.sdk/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/Headers/Events.h - The second
parameters
value are key codes. Key codes can be found in https://eastmanreference.com/complete-list-of-applescript-key-codes - The first
parameters
value are ASCII codes for the key. Since you’re dealing with function keys, that value will be65535
- If you’re trying to disable a hotkey, it’s safe to assume that
enabled = 1
What does each part in com.apple.symbolichotkeys.plist mean? has more info on how to decode com.apple.symbolichotkeys.plist
Putting all those together:
- Since you’re dealing with ⌥ and Fn, the third
parameters
value should be 524288 + 8388608 which is equal to 8912896 - The second
parameters
value should be 107 for F14 and 113 for F15
55 = {
enabled = 1;
value = {
parameters = (
65535,
107,
8912896
);
type = standard;
};
};
56 = {
enabled = 1;
value = {
parameters = (
65535,
113,
8912896
);
type = standard;
};
};
To disable those, execute:
defaults write com.apple.symbolichotkeys.plist AppleSymbolicHotKeys -dict-add 55 "
<dict>
<key>enabled</key><false/>
<key>value</key><dict>
<key>type</key><string>standard</string>
<key>parameters</key>
<array>
<integer>65535</integer>
<integer>107</integer>
<integer>8912896</integer>
</array>
</dict>
</dict>
"
defaults write com.apple.symbolichotkeys.plist AppleSymbolicHotKeys -dict-add 56 "
<dict>
<key>enabled</key><false/>
<key>value</key><dict>
<key>type</key><string>standard</string>
<key>parameters</key>
<array>
<integer>65535</integer>
<integer>107</integer>
<integer>8912896</integer>
</array>
</dict>
</dict>
"
Then to reload the system hotkeys, execute /System/Library/PrivateFrameworks/SystemAdministration.framework/Resources/activateSettings -u