Saturday, April 13, 2024

How to remap a keyboard in macOS

Say you’re a Mac user who just got a fancy new keyboard, but it has a Windows layout. Or you want to use the same keyboard with both Windows and Mac machines. Or you’ve gotten used to a specific layout, and now your muscle memory is all wrong.

The biggest differences between Macs and Windows PCs are in the bottom row modifier keys. Windows computers have Ctrl, Win, and Alt, whereas Macs have Control, Option, and Command. macOS automatically maps the Alt to Option and Win to Command. But Windows uses the Control key for most of the shortcuts that Macs use the Command key for, which means you have to remember to copy / paste using your pinkie on one computer and using your index finger on another. Who wants that?

You could try to rewire your brain — and there’s something to be said for neuroplasticity — or you could remap your keyboard so the modifiers are where your fingers want them to be. 

If you have a fancy mechanical keyboard, it might come with software to let you remap the keys at the hardware level. Or your keyboard might have a Mac / Windows switch that flips the modifier positions. But you can remap any keyboard, including the one on your MacBook, with a couple of free macOS tools. 

How to remap modifier keys in macOS Ventura or Monterey

Screenshot of the Modifier Keys dialog in macOS Ventura.

macOS lets you reassign certain modifier keys to other modifiers. It’s limited but effective for making a Windows keyboard play nice.

If you just want to put the modifier keys where your fingers expect them to be, you can do that within macOS. 

If you’re using macOS Ventura:

  • Open System Settings, scroll to Keyboard, and select Keyboard Shortcuts… 
  • Hit Modifier Keys at the bottom of the left menu pane. 
  • Select your keyboard from the dropdown menu. 

If you’re using macOS Monterey:

  • Open System Preferences and select Keyboard
  • Hit the Modifier Keys … button on the lower right 
  • Select your keyboard from the dropdown menu. 

Here you can swap the locations of Caps Lock, Control, Option, Command, and Function (or Globe) keys. On my MacBook’s built-in keyboard, I use this to put the Command key where Caps Lock usually goes since that’s where I put it on my other keyboards. On my external keyboard, I’ve already changed Caps Lock to Control in the firmware, so I use this tool to swap Control and Command, which puts Command on the Caps Lock key on that keyboard, too. 

Yes, this is weird. But not as weird as dedicating a giant key on the home row to Caps Lock. 

Remap your entire keyboard in macOS using Karabiner Elements

Screenshot of the Simple Modifications tab of Karabiner Elements

To swap the positions of two keys in Karabiner Elements, you’ll need two rules.

For more complex modifications or to remap other keys, you can use a free program called Karabiner Elements. Karabiner can assign just about any keycode to any key, as well as perform more complex modifications. I use it to swap the Backspace and backslash keys on my MacBook’s internal keyboard to match my external keyboard and swap Command and Control on my external keyboard in lieu of the built-in tool. 

Karabiner can do much more than just swap key positions, though. You can change the functions of the function keys, assign hotkeys to launch specific programs or send multiple keycodes with one key — turning Caps Lock into Cmd + Control + Option + Shift, for example. You can make keys do one thing when tapped and another when held, use the keyboard to control the mouse cursor, and more. And you can assign different behaviors to different keyboards. 

Screenshot of the “Complex Modifications” tab of Karabiner Elements

Karabiner supports complex remapping and comes with a directory of useful user-generated modifications.

The easiest way to mess around with complex modifications using Karabiner is to download a few that other users have submitted. You can also write your own in a JSON file, but that’s way outside the scope of this article. Even the web GUI that was built to make it easier is not exactly beginner friendly. 

One word of caution: make sure you don’t double-dip. I couldn’t figure out why my Command and Control keys weren’t swapped until I realized that I had set up the same swap in both macOS and Karabiner Elements. To paraphrase Mitch Hedberg: I remapped a remap; it was back to normal. 

I’ve barely scratched the surface of Karabiner Elements myself. Though my preference is still for keyboards where you can do all of the above in firmware, Karabiner works on any old keyboard, and that’s why it’s great. 


This website uses cookies. By continuing to use this site, you accept our use of cookies.