Mapping macOS Keyboard Layout on Windows

2021-09-16

macOS
windows
keyboard

The main modifier (control) key placement on windows keyboards is unpleasant at best. Switching to a windows keyboard after years on a macOS keyboard layout is painful. Luckily you can get some of the macOS keybinds on Windows with some tools.

After over ten years of using a Mac, it was difficult to switch between a macOS and windows machine. One of the most annoying thing however wasn't the operating system itself (Windows has come a long way since Vista to their credit), but the keyboard layout. Fingers having being used to the shortcuts on the Mac keyboard, my little finger wasn't comfortable with it being used too much hitting the damn corner control key.

Luckily as I soon found out, you can swap the misplaced corner Control keys with more ergonomic thumb-pressable Alt keys.

Mapping macOS Keyboard Layout on Windows

User Randy has authored SharpKeys on Windows to rebind a key to another (without having to mess around with registry settings).

Download and install Sharp Keys, and then open it up.

Sharp Keys
Sharp Keys

Now add four mappings using the Add modal in SharpKeys

KeyMap to
Left AltLeft Ctrl
Left CtrlLeft Alt
Right AltRight Ctrl
Right CtrlRight Alt

Key mapping
Key mapping

Finally Write to Registry and reboot. You can now use the Alt as the Ctrl key.


This alone isn't perfect however, some shortcuts like Alt-Tab and Ctrl-Tab switch between windows and tabs respectively on both Windows and macOS, but since we've reversed behavior of Alt and Ctrl, we need to switch it back, as well as add shortcuts for spotlight, quick folder opening, etc.

AutoHotkey comes to the rescue here. It's an automation script runner. We need to create a script for it to run on startup.

Download and install AutoHotkey.

From the windows run dialog (Win-R), enter shell:startup to open up the windows startup script folder. Any script here runs at startup.

Shell startup
Shell startup

Create a new AutoHotkey script in this folder (Any file with .ahk extension)

New Autohotkey script
New Autohotkey script

Call it whatever you want, e.g. osxmapper.ahk.

Startup folder
Startup folder

Add the following code to the file.

You can also download the file here.

Run the script (It'll automatically run on next login).

This should map Windows nicely to the most common shortcuts used on macOS. Common examples include:

ActionmacOSWindows
Screenshot (Full screen)Command Shift 3Ctrl (Or Windows) Shift 3
Screenshot (Snip)Command Shift 4Ctrl Shift 4 (Requires snip tool)
Search (Spotlight)Command SpaceCtrl Space
Hiding current appCommand HCtrl H
Quitting current appCommand QCtrl Q

Note that Ctrl key will now be the Alt key on the keyboard (Unless you've swapped the physical key as well :p).

More AHK Commands: AutoHotkey is quite customizable – Allowing application and group specific commands. It could be tailored for applications that for some reason have a different shortcut on macOS and Windows. Julio Merino has written additional commands for mapping macOS features AutoHotkey for some groups.

© avikantz, 2024