1

I use Firefox and Chrome as my main navigators, but I use sometimes Safari to test some developments.

On Firefox and Chrome, typing an URL in the address bar and then pressing Alt + Return makes a new tab to be opened.

On Safari, typing an URL in the address bar and then pressing Alt + Return makes the target address saved to a file (which annoys me because it makes an unuseful file in my Download folder).

To open a new tab after typing the address, I have to use the Cmd + Return.

I wonder if it is possible to swap cmd and alt key only for Safari (not other apps) and how to do this, or at least make Safari open a new tab when I press Alt+Return in the address bar.

One last thing: I am on Mavericks

Any idea ?

1 Answer 1

2

You can use Karabiner with a private.xml such as this:

<?xml version="1.0"?>
<root>
  <appdef>
    <appname>SAFARI</appname>
    <equal>com.apple.Safari</equal>
  </appdef>
  <item>
    <name>Swap ⌥↩︎ and ⌘↩︎</name>
    <identifier>SwapAltEnterAndCmdEnter</identifier>
    <only>SAFARI</only>
    <autogen>
      __KeyToKey__
      KeyCode::RETURN, VK_COMMAND | ModifierFlag::NONE,
      KeyCode::RETURN, ModifierFlag::OPTION_L
    </autogen>
    <autogen>
      __KeyToKey__
      KeyCode::RETURN, VK_OPTION | ModifierFlag::NONE,
      KeyCode::RETURN, ModifierFlag::COMMAND_L
    </autogen>
  </item>
</root>

You can find the manual here to know how to edit the private.xml file and update your configuration.

You have to check the small checkbox of the newly defined rule to make it work.

2
  • 1
    The KeyRemap4MacBook expert to the rescue ;)
    – Thecafremo
    Commented Feb 6, 2014 at 16:26
  • Great! I have to add that you can read the manual here to know how to edit the private.xml file: pqrs.org/macosx/keyremap4macbook/document.html.en. And that you have to check the small checkbox of the new defined rule to make it work.
    – lauhub
    Commented Feb 12, 2014 at 14:33

You must log in to answer this question.

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