devAlice
← Multi-OS

Mac ↔ Windows keyboard mapping — Karabiner + PowerToys Keyboard Manager

Smooth out the Cmd ↔ Ctrl divide between the two OSes. Karabiner-Elements (Mac) and PowerToys Keyboard Manager (Windows) setup plus five common remappings.

The biggest friction for people who use both Mac and Windows — the Cmd ↔ Ctrl swap. macOS uses Cmd + C to copy; Windows uses Ctrl + C. On Mac, Ctrl sits in the awkward bottom-corner; on Windows, the Win key is rarely used. After adapting to one OS, your hands keep missing on the other.

This guide unifies key behavior across both OSes using Karabiner-Elements (Mac) and PowerToys Keyboard Manager (Windows). Five common remappings + per-app mappings + troubleshooting.

Audience: developers using both Mac and Windows. External-keyboard users (HHKB, Filco, etc.) apply the same.

TL;DR

  1. Mac: Karabiner-Elements (brew install --cask karabiner-elements)
  2. Windows: PowerToys bundle (winget install Microsoft.PowerToys) → Keyboard Manager
  3. Map same physical key → same action across both OSes (unify Cmd ↔ Ctrl)
  4. External keyboards can auto-switch OS via layer / dip switch
  5. If corporate policy blocks PowerToys, use AutoHotkey as a substitute

Prerequisites

  • macOS 14+ and Windows 11 22H2+ on both machines
  • Admin rights on both

1. Approach — which side adapts?

Three options:

A. Make Mac feel like Windows (Windows users new to a Mac)

  • Map Cmd → Ctrl via Karabiner
  • Some Mac-native shortcuts break (Spotlight, etc.)
  • Recommendation: medium

B. Make Windows feel like Mac (Mac users forced onto Windows)

  • Map Win → Ctrl (or the reverse) via PowerToys
  • Some Windows-native shortcuts break (Win + Tab, etc.)
  • Recommendation: medium

C. Tweak both moderately (most common)

  • Respect each OS's native keys, only unify the shortcuts you use daily
  • Gentlest learning curve
  • Recommendation: high

This guide focuses on Approach C. A and B reuse the same setup but with different mapping tables.


2. Mac — Karabiner-Elements setup

2.1 Install

brew install --cask karabiner-elements

Or download from karabiner-elements.pqrs.org.

First launch prompts for five macOS permissions:

  • Input Monitoring (Karabiner)
  • Input Monitoring (Karabiner-EventViewer)
  • Accessibility (Karabiner)
  • Accessibility (karabiner_grabber)
  • Developer Tools (optional)

System Settings → Privacy & Security → grant each.

2.2 Keyboard detection

Karabiner auto-detects external keyboards. Settings → Devices shows them.

2.3 Simple modifications

Use the Simple Modifications tab to add a pair.

FromTo
right_controlright_command
caps_lockescape (or control for vim users)
right_optionright_command (optional — widens the Cmd area)

2.4 Complex Modifications

Conditional mappings are defined in JSON. Edit ~/.config/karabiner/karabiner.json or add via the GUI.

Common: make "Cmd + key" act as Windows-style "Win + key" on an external keyboard:

{
  "description": "Map left_command to left_control (for Windows layout keyboard)",
  "manipulators": [
    {
      "type": "basic",
      "from": { "key_code": "left_command" },
      "to": [{ "key_code": "left_control" }],
      "conditions": [
        {
          "type": "device_if",
          "identifiers": [
            { "vendor_id": 1278, "product_id": 33 }  // external keyboard ID
          ]
        }
      ]
    }
  ]
}

Find the vendor/product ID of your external keyboard via Karabiner-EventViewer.


3. Windows — PowerToys Keyboard Manager

3.1 Install PowerToys

winget install Microsoft.PowerToys

Or github.com/microsoft/PowerToys.

3.2 Enable Keyboard Manager

Launch PowerToys → left menu → Keyboard Manager → toggle Enable Keyboard Manager.

3.3 Remap a key

Click Remap a key → add a pair.

KeyMapped To
Caps LockEsc
Right CtrlRight Win (matches Mac's Cmd position)
Right AltRight Ctrl

3.4 Remap a shortcut

Remap a shortcut — chord-to-chord.

Common: macOS's Cmd + Space (Spotlight) → Windows's Alt + Space (PowerToys Run):

FromTo
Win + SpaceAlt + Space
Win + CCtrl + C
Win + VCtrl + V
Win + TabAlt + Tab

Leave "Target App" empty for global; fill it in to limit to one app.

3.5 AutoHotkey alternative (when PowerToys is blocked)

AutoHotkey is a single exe with the same effect. mac-like.ahk:

; Make Mac-style Win+key behave like Ctrl+key
LWin & c::Send ^c
LWin & v::Send ^v
LWin & x::Send ^x
LWin & z::Send ^z
LWin & a::Send ^a
LWin & s::Send ^s
LWin & Space::Send !{Space}  ; PowerToys Run

Run mac-like.ahk → it lives in the system tray.


4. Five common remappings (recommended)

Apply on both OSes:

IntentMac (Karabiner)Windows (PowerToys)
Caps Lock → Esccaps_lockescapeCaps Lock → Esc
Widen right modifiersright_optionright_commandRight Alt → Right Ctrl
Widen left modifiers(default)Right Ctrl → Right Win
IME toggle (external keyboard)right_commandf19 + IM shortcut(Windows native IME toggle)
New-tab consistency(default Cmd+T)(PowerToys: keep Ctrl+T)

5. External keyboards — auto OS switching (optional)

Some keyboards (HHKB, Niz Plum, etc.) offer dip switches or OS-mode keys for OS-aware layouts.

HHKB Professional Hybrid

  • DIP switches on the back, or Fn+Q/W/E on the device
  • Mac mode / Win mode / Lite mode

Niz Plum

  • Fn+/ on the device, or layout switching via software

QMK/VIA custom keyboards

  • Per-layer mapping via VIA / QMK firmware
  • Auto-switch via USB cable port (host PC recognized)

When the external keyboard has its own OS modes, Karabiner / PowerToys carry less weight.


6. Per-app mapping (common patterns)

macOS — Karabiner's frontmost_application_if

Mapping that activates in a specific app:

{
  "description": "VS Code only: Cmd+B → Ctrl+B (same shortcut as Linux/Win)",
  "manipulators": [
    {
      "type": "basic",
      "from": { "key_code": "b", "modifiers": { "mandatory": ["left_command"] } },
      "to": [{ "key_code": "b", "modifiers": ["left_control"] }],
      "conditions": [
        {
          "type": "frontmost_application_if",
          "bundle_identifiers": ["^com\\.microsoft\\.VSCode$"]
        }
      ]
    }
  ]
}

Windows — PowerToys' Target App

In Remap a shortcut, set Target App to the process name:

  • VS Code: Code.exe
  • Chrome: chrome.exe
  • WSL: wt.exe (Windows Terminal)

7. Verify

Mac

# Check Karabiner is firing
open /Applications/Karabiner-EventViewer.app
# → Press keys; events appear. Mappings show as a from → to transform.

Windows

  • PowerToys → Keyboard Manager → Remappings list
  • Type into any text field, confirm the remapped behavior
  • (AutoHotkey) Green H icon in the system tray

8. Troubleshooting

macOS Sequoia keeps revoking Karabiner permissions

  • After macOS updates, the security model re-prompts often
  • System Settings → Privacy & Security → toggle Input Monitoring / Accessibility OFF then ON for Karabiner
  • Or reinstall Karabiner

PowerToys Keyboard Manager doesn't work in some apps

  • Apps running as admin (some games) bypass PowerToys
  • Run PowerToys as admin (tray icon → Restart as administrator)

After mapping, only the external keyboard misbehaves

  • Karabiner: in Devices, select the keyboard and check "Modify events from this device"
  • PowerToys: vendor-specific keys (e.g., Logitech G502 side buttons) can't be remapped

macOS IME-toggle key stops working

  • System Settings → Keyboard → Input Sources → Shortcuts: check the IME toggle
  • With Karabiner, map the external keyboard's right_command to the IME toggle:
    {
      "from": { "key_code": "right_command" },
      "to": [{ "key_code": "japanese_kana" }]   // recognized by the Korean IME
    }

Windows Win + L (lock) was remapped

  • Reserved security shortcut. PowerToys remaps won't intercept it (Windows takes priority)
  • AutoHotkey can't override it either
  • No workaround — pick a different shortcut

Mac vs Windows IME conflict on a shared Bluetooth keyboard

  • Same Bluetooth keyboard paired with both → the last-used OS's IME state lingers
  • Use the keyboard's OS-mode toggle (HHKB Fn+Q/W/E)
  • Or unpair and re-pair when switching

9. What's next


References

Changelog

  • 2026-05-16: First draft. Karabiner + PowerToys install + five common remappings + per-app + external keyboards + six troubleshooting cases.

Comments