You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Remapping the F4 key to Launchpad from Spotlight automatically on start

Well, below written code works in Terminal but the key resets to Spotlight after every restart. I'd love to know if there is a permanent way to remap the Spotlight key(F4) to launchpad since CMD+Space is easy enough to remember :)


hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0xC00000221,"HIDKeyboardModifierMappingDst":0x0C000002A2}]}'

MacBook Pro 14″, macOS 12.0

Posted on Dec 23, 2021 4:42 AM

Reply
Question marked as Top-ranking reply

Posted on Jan 13, 2022 7:19 PM

Guys if you want to change buttons F4 (launchpad), F5 (brightness low) and F6 (brightness up) as it was before on older Macs just add this code into your Library folder:

~/Library/LaunchAgents` saving the file with .plist extension (full name of file should be: com.local.KeyRemapping.plist)

It will Remapping your keyboard settings on launch of your system.


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.local.KeyRemapping</string>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/bin/hidutil</string>
        <string>property</string>
        <string>--set</string>
        <string>{"UserKeyMapping":[
            {
              "HIDKeyboardModifierMappingSrc": 0xC000000CF,
              "HIDKeyboardModifierMappingDst": 0xFF00000009
            },
            {
              "HIDKeyboardModifierMappingSrc": 0x10000009B,
              "HIDKeyboardModifierMappingDst": 0xFF00000008
            },
              {
              "HIDKeyboardModifierMappingSrc": 0xC00000221,
              "HIDKeyboardModifierMappingDst": 0x0C000002A2
            }
        ]}</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
</dict>
</plist>

Similar questions

23 replies

Dec 27, 2021 7:11 PM in response to ataaral

For those like me who have never used Automator app.

1. Open Automator app > New document > Click on Quick Action and choose it.

2. Library > Run AppleScript > Copy and Paste the following:


on run {input, parameters}


tell application "Terminal"


activate


do script with command "hidutil property --set '{\"UserKeyMapping\":[{\"HIDKeyboardModifierMappingSrc\":0xC00000221,\"HIDKeyboardModifierMappingDst\":0x0C000002A2}]}'"


end tell


tell application "Terminal" to quit


return input

end run


3. Click play, the close automator. Spotlight key (F4) should pull up launchpad.

Remapping the F4 key to Launchpad from Spotlight automatically on start

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.