#!/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} | |
]}" |
This comment has been minimized.
This comment has been minimized.
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
This comment has been minimized.
Do you know how can i remap the fn key on my external keyboard? Karabiner doesn't detect my fn keystrokes as well.