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 Best reply

Posted on Dec 24, 2021 6:50 AM

BlueberryLover wrote:

Couldn't you run an Apple Script via an Automator app to execute the required Terminal command (example below illustrates executing the "pwd" command)? The Automator app could then be set up as a login item (in Users & Groups System Preference).

- Pie Lover
P.S. I also found an article that may be of interest



https://discussions.apple.com/content/attachment/d44fd049-5e1c-4649-b355-9fec5d4641d6

So basically this is the end version after your suggestion, thanks for all the help from everyone:


Similar questions

23 replies

Jan 13, 2022 7:19 PM in response to ataaral

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>

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 ID.