0

What is the coding to program my F1 key to launch an application that needs to be defined (like Notes) using Karabiner?

1

The coding is similar to your question here: Karabiner F1 to Launch Safari? You have to add a vkopenurldef tag though.

Some apps are already defined here:

/Applications/Karabiner.app/Contents/Resources/vkopenurldef.xml

After an update or an upgrade the file may be overwritten so customize your private.xml and add:

    <vkopenurldef>
        <name>KeyCode::VK_OPEN_URL_APP_Application</name>
        <url type="file">/Path/to/application</url>
    </vkopenurldef>
    <item>
        <name>F1 Application</name>
        <identifier>f1_application</identifier>
    <autogen>__KeyToKey__ KeyCode::F1, KeyCode::VK_OPEN_URL_APP_Application</autogen>
    </item>

Example:

    <vkopenurldef>
        <name>KeyCode::VK_OPEN_URL_APP_Notes</name>
        <url type="file">/Applications/Notes.app</url>
    </vkopenurldef>
    <item>
        <name>F1 Notes</name>
        <identifier>f1_notes</identifier>
    <autogen>__KeyToKey__ KeyCode::F1, KeyCode::VK_OPEN_URL_APP_Notes</autogen>
    </item>

Then enable it in Change Key. Depending on your settings (Consumer Keys or F1-F12 for the F-keys) in System Preferences -> Keyboard -> Keyboard -> F-key behavior you may have to hit the fn-key also.

  • @BlackOrnament App definition is a different beast! App definitions are used to restrict key codes to single apps. Example: cmd_r-s in Word can be defined differently to cmd_r-s in Excel with an app definition included. You may redirect cmd-shift-s to cmd_r-s in Word but don't want that behavior in other apps. Then you add a (predefined) appdef to the key code and thus restrict the mod to Word. – klanomath Apr 15 '16 at 17:49
  • How would one modify the private.xml to launch an outside App like Microsoft Word? Apologies, I'm out of my element & have constantly failed trying to insert it into your fantastic examples – BlackOrnament Apr 15 '16 at 17:58
  • @BlackOrnament Apparently this doesn't work with Microsoft apps or I don't get it to work. Maybe I find another way... – klanomath Apr 15 '16 at 18:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .