On my external mechanical keyboard the Super/Windows/CMD key is between Ctrl and Alt, but on the Mac keyboard it's between Alt and Space.

Can I swap CMD and Alt only on the external keyboard?


3 Answers 3


There is a section dedicated to this under System PreferencesKeyboard:


Open Modifier Keys… and reassign them from here:

Modifier Keys

These settings are specific to each external keyboard you have connected. They will “stick” between reboots, as well as whenever you unplug an external keyboard and plug back it in.

  • 1
    For some reason on my installation in macOS Sierra, there is no "Select keyboard" dropdown at all. The settings there only modify the built-in keyboard of my MacBook Pro. Commented Nov 11, 2018 at 22:56
  • 1
    For newer laptops "Modifier Keys" is not listed there. Search for "modifier keys" in  → System Preferences. Select the result under "Keyboard".
    – Shannon
    Commented Jan 17, 2023 at 18:27
  • Careful with this setting, it defaults to the built in trackpad at the top
    – Siddhartha
    Commented Aug 7, 2023 at 19:58

The built-in macOS solution did not work for me because there's no option to select a different keyboard.

For macOS Sierra to Mojave (current release as of right now), Karabiner-Elements does exactly this. You can find the GitHub page at https://github.com/tekezo/Karabiner-Elements.

It runs in the background. In the preferences, you configure the target device for modification and it remembers the settings. I have a bluetooth keyboard (Logitech G613) where only that keyboard's CMD and ALT are swapped. I use this keyboard between my PC and Mac.

Below you see an example of Karabiner-Elements v12. It doesn't show my G613 because it is not connected right now.

enter image description here


I use Karabiner for my external KB, I think it's the only utility currently available but Google is your friend. As to the second question - so far as I know, only if you can figure out a way to run Karabiner when the external KB is attached but not otherwise. HTH.

  • 1
    The central problem is I want a solution that doesn't require me to reconfigure something every time I connect my external keyboard. I haven't found a solution on google, that's why I'm asking here.
    – macurie
    Commented Jan 26, 2016 at 22:51
  • @macurie In order to achieve not having to configure anything when you reconnect your keyboard you will need a keyboard that has a firmware which will allow you to reprogram the keyboard. There are many keyboards which support open source firmware such as QMK (qmk.fm) that will allow you to reprogram the key codes that are sent from the keyboard itself so that there is no configuration required when connecting the keyboard or moving between machines.
    – Cory Gross
    Commented Jan 7, 2022 at 20:37

You must log in to answer this question.

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