Last active
August 12, 2021 14:21
-
-
Save zbstof/6cba7d54e105cc5148c8a943d1581cad to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# To run at startup: | |
# sudo defaults write com.apple.loginwindow LoginHook `pwd`/remap.sh | |
# https://developer.apple.com/library/content/technotes/tn2450/_index.html | |
CAPS_LOCK="0x700000039" | |
ESCAPE="0x700000029" | |
NON_US_BACKSLASH_PLUS_MINUS="0x700000064" | |
GRAVE_ACCENT_AND_TILDE="0x700000035" | |
SLASH_PIPE="0x700000031" | |
ENTER_RETURN="0x700000028" | |
RIGHT_SHIFT="0x7000000E5" #Do nothing button | |
FROM="\"HIDKeyboardModifierMappingSrc\"" | |
TO="\"HIDKeyboardModifierMappingDst\"" | |
hidutil property --set "{\"UserKeyMapping\":[ | |
{$FROM: $CAPS_LOCK, $TO: $ESCAPE}, | |
{$FROM: $ESCAPE, $TO: $RIGHT_SHIFT}, | |
{$FROM: $GRAVE_ACCENT_AND_TILDE, $TO: $SLASH_PIPE}, | |
{$FROM: $SLASH_PIPE, $TO: $ENTER_RETURN}, | |
{$FROM: $NON_US_BACKSLASH_PLUS_MINUS, $TO: $GRAVE_ACCENT_AND_TILDE} | |
]}" |
Hm, don't know how to help you. The table provided in the technotes doesn't have Fn listed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Do you know how can i remap the fn key on my external keyboard? Karabiner doesn't detect my fn keystrokes as well.