logoalt Hacker News

junk245435254today at 4:38 AM0 repliesview on HN

Yep, this is what I have in my Bash config, for the external Microsoft Natural Keyboard attached to my Mac:

    # note: works for e.g. Fn-F (fullscreen), but not Fn-F{1..12} (brightness etc.)
    alias app2fn+=$'hidutil property --set \'{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000065,"HIDKeyboardModifierMappingDst":0xFF00000003}]}\''
    alias app2fn-=$'hidutil property --set \'{"UserKeyMapping":[]}\''
    alias app2fn?=$'hidutil property --get "UserKeyMapping"'