Connecting an external mechanical keyboard or standard desktop peripheral designed for Windows to a Mac is a popular setup for desktop workstations. However, the physical layout of the bottom-left modifier keys differs between operating systems. On an Apple keyboard, the layout from left to right is Control, Option, and Command. On a Windows keyboard, the physical keys are arranged as Control, Windows (Win), and Alt. By default, macOS maps the Windows key to Command and the Alt key to Option, reversing the expected thumb positions for common shortcuts like Cmd + C or Cmd + V.
In this guide, you will learn how to remap modifier keys natively in macOS System Settings, swap the Windows and Alt keys, assign device-specific mappings, and remap the Caps Lock key to Escape or Control.
Understanding Modifier Key Mapping in macOS
Unlike third-party keyboard utilities that run persistent background daemons, macOS features built-in, kernel-level modifier key remapping. Crucially, macOS allows you to apply modifier remappings on a per-device basis. This means you can swap the keys on your external USB or Bluetooth keyboard without disrupting the built-in keyboard on your MacBook.
You can customize six primary modifier keys:
- Caps Lock Key (⇪)
- Control Key (⌃)
- Option Key (⌥ / Alt)
- Command Key (⌘ / Win)
- Globe / Fn Key
- Escape Key (⎋)
How to Swap Windows and Alt Keys in macOS
To restore standard Mac muscle memory on a Windows keyboard layout, swap the positions of the Windows and Alt keys so that the physical Alt key (immediately adjacent to your spacebar) acts as the Mac Command key.
- Click the Apple menu () in the top-left corner of the screen and select System Settings.
- Scroll down the left sidebar and click Keyboard.
- Click the Keyboard Shortcuts… button in the main panel.
- In the modal window that appears, select Modifier Keys from the left-hand navigation list.
- At the top of the dialog, locate the Select keyboard drop-down menu. Choose your external Windows keyboard from the list (ensure you do not select “Internal Keyboard”).
- Adjust the modifier assignments:
- Find Option (⌥) Key: Click the drop-down and set it to ⌘ Command.
- Find Command (⌘) Key: Click the drop-down and set it to ⌥ Option.
- Click Done to save your changes immediately.
Now, pressing the physical Alt key executes Command (enabling standard thumb-presses for Cmd + C, Cmd + Space, etc.), while the physical Windows key acts as Option.
Remapping Caps Lock to Escape or Control
Programmers, software engineers, and terminal power users frequently use the Escape or Control keys for text navigation (e.g., in Vim, Emacs, or IDEs). Because the physical Caps Lock key occupies prime real estate on the home row, remapping it significantly improves ergonomic typing speed.
- Navigate to System Settings > Keyboard > Keyboard Shortcuts… > Modifier Keys.
- Select your target keyboard.
- Locate the Caps Lock (⇪) Key row.
- Click the drop-down menu and choose:
- ⎋ Escape: Ideal for Vim users and modal editors.
- ⌃ Control: Ideal for Unix shell navigation (e.g.,
Ctrl + C,Ctrl + R,Ctrl + A). - No Action: Disables the key entirely to prevent accidental all-caps yelling.
- Click Done.
Restoring Default Modifier Key Mappings
If you switch to a dedicated Mac-compatible external keyboard or wish to reset your modifications:
- Return to System Settings > Keyboard > Keyboard Shortcuts… > Modifier Keys.
- Ensure the correct keyboard device is selected.
- Click the Restore Defaults button in the lower-left corner of the window.
- Click Done.
Troubleshooting External Keyboard Recognition
Keyboard Does Not Appear in the Drop-Down Menu
If your external keyboard does not show up in the “Select keyboard” list:
- Unplug and reconnect the USB cable or toggle Bluetooth off and on.
- If your keyboard has a physical hardware switch (e.g., Mac/Win or Bluetooth/2.4G toggle on Keychron, Logitech, or NuPhy boards), ensure it is set to the correct operating mode.
macOS Identifies Keyboard as ISO Instead of ANSI
If the key next to the left Shift key behaves unexpectedly, run the Keyboard Setup Assistant:
- Go to System Settings > Keyboard.
- Click Change Keyboard Type….
- Follow the on-screen prompts to press the keys immediately adjacent to the left and right Shift keys to identify whether your board is ANSI (US standard) or ISO (European standard).