Skip to content

Instantly share code, notes, and snippets.

@jimratliff
Last active May 29, 2018 04:25
Show Gist options
  • Select an option

  • Save jimratliff/5cbd68210e12e5bf0245065fd5de3844 to your computer and use it in GitHub Desktop.

Select an option

Save jimratliff/5cbd68210e12e5bf0245065fd5de3844 to your computer and use it in GitHub Desktop.
Masks for all combinations of modifier-key presses (involving Fn, Shift, Option, Command, and Control) in macOS. (See sources/information in first comment.) #dotfiles #character_codes #symbolichotkeys
Modifier Combination Mask
<No modifiers> 0
Shift 131072
Control 262144
Shift+Control ⇧⌃ 393216
Option 524288
Shift+Option ⇧⌥ 655360
Control+Option ⌃⌥ 786432
Shift+Control+Option ⇧⌃⌥ 917504
Command 1048576
Shift+Command ⇧⌘ 1179648
Control+Command ⌃⌘ 1310720
Shift+Control+Command ⇧⌃⌘ 1441792
Option+Command ⌥⌘ 1572864
Shift+Option+Command ⇧⌥⌘ 1703936
Control+Option+Command ⌃⌥⌘ 1835008
Shift+Control+Option+Command ⇧⌃⌥⌘ 1966080
Fn Fn 8388608
Fn+Shift Fn⇧ 8519680
Fn+Control Fn⌃ 8650752
Fn+Shift+Control Fn⇧⌃ 8781824
Fn+Option Fn⌥ 8912896
Fn+Shift+Option Fn⇧⌥ 9043968
Fn+Control+Option Fn⌃⌥ 9175040
Fn+Shift+Control+Option Fn⇧⌃⌥ 9306112
Fn+Command Fn⌘ 9437184
Fn+Shift+Command Fn⇧⌘ 9568256
Fn+Control+Command Fn⌃⌘ 9699328
Fn+Shift+Control+Command Fn⇧⌃⌘ 9830400
Fn+Option+Command Fn⌥⌘ 9961472
Fn+Shift+Option+Command Fn⇧⌥⌘ 10092544
Fn+Control+Option+Command Fn⌃⌥⌘ 10223616
Fn+Shift+Control+Option+Command Fn⇧⌃⌥⌘ 10354688
@jimratliff

Copy link
Copy Markdown
Author

This table is useful for editing the com.apple.symbolichotkeys plist in macOS. Regarding editing the com.apple.symbolichotkeys plist, see, for example:
*Charles Edge, "Defaults & symbolichotkeys in Mac OS X," krypted.com, September 7, 2010.
*fracai et al., "Documenting com.apple.symbolichotkeys.plist," Mac OS X Hints, 11/9/2010, via WayBackMachine.

Related: See Gist "ASCII and Mac Virtual Key codes for editing com.apple.symbolichotkeys plist."

The mask for each combination of modifier keys is used in the third parameter (Item 2) in the parameters array in the hotkey's entry in the symbolichotkeys dictionary.

For the calculation of the mask, see "Question - Translating Apple's Function-Key Unicodes to hs.keycodes? #1021," GitHub/Hammerspoon/hammerspoon » Issues #1021. More specifically, see the Google Sheets document Modifier keys for combinations of modifier-key presses in macOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment