How to re-map command and option keys on Mac OS X with a PC-keyboard?

94,724

Solution 1

The answer was as easy as this:

  • Click the Apple logo in the top left of your screen
  • Select "System Preferences"
  • Select "Keyboard"
  • Make sure the "Keyboard" "tab" is selected
  • Select the "Modifier Keys..." button in the bottom right of the window
  • Select keyboard: "USB Keyboard" (probably - if you're like me, you're trying to configure a keyboard that's plugged in to your laptop)
  • Switch the "Option" and "Command" values

enter image description here

Solution 2

DoubleCommand can remap keys, you just need to know the Mac keyboard equivalents on your keyboard:

enter image description here

DoubleCommand is free and open source

Solution 3

I recommend this keymap software for Mac OSX: http://pqrs.org/macosx/keyremap4macbook/ I used doublecommand before, feel this is better.

Solution 4

If you're trying to do something that the built-in OSX preferences or apps like DoubleCommand can't change — like remap right-control to command but leave left-control as is — you can do that with a little Terminal hacking:

http://hints.macworld.com/article.php?story=20060825072451882

Share:
94,724

Related videos on Youtube

Petruza
Author by

Petruza

General software engineer, golang advocate, also typescript, C, C++, GDScript dev. Interested in emulation, video games, image processing, machine learning, computer vision, natural language processing, web scraping.

Updated on September 17, 2022

Comments

  • Petruza
    Petruza over 1 year

    in my keyboard the command key is mapped to the windows key (I'm using a regular PC keyboard) so I only have a left command, because the space on the right is occupied by the useless Fn key.

    I've used Ukelele and also edited keyboard mappings but that's for printable characters, doesn't actually allow you to map modifier keys on the keyboard.

    Thanks!

    • Chris Johnsen
      Chris Johnsen over 14 years
      Check in the Keyboard tab of the “Keyboard & Mouse” preference pane in System Preferences. Back in 10.4 there is a “Modifier Keys…” that lets you remap the modifier keys. With it you could reassign (for example) Control or Alt be your Command key. Maybe it is also there in whichever version of Mac OS X you are using.
    • John
      John almost 7 years
      Up-voted for correctly referring to the Fn key as useless.
  • Eric Wendelin
    Eric Wendelin over 14 years
    +1 I just made the switch and DoubleCommand saved me!
  • Petruza
    Petruza over 14 years
    Thanks, I'll give it a try. This software is always running or it just makes the changes and they stay in the OS? Also, isn't any plist file anywhere to do this? Thanks!
  • WestCoastProjects
    WestCoastProjects over 8 years
    This is a basic/primitive starting point. Karabiner offers many more options.
  • Jonas Alves
    Jonas Alves over 8 years
    Still valid for OS X Yosemite 10.10. Thanks!
  • Virus_7
    Virus_7 about 7 years
  • Virus_7
    Virus_7 about 7 years
    Karabiner-Elements (previously called KeyRemap4MacBook) is breaking Eject button on macOS Sierra, so logout shortcut doesn't work. I found working built-in solution which works for me: Changing modifier keys from the command line.
  • Robert Metzger
    Robert Metzger over 4 years
    Sadly, what is supposed to be the right option key is w/o functionality (it's a "fn" key on my keyboard). Having that key as an option key would allow for curly/squared braces on german windows keyboards.
  • Petruza
    Petruza about 4 years
    @RobertMetzger hey, I asked this 10 years ago, do you know how can I prevent getting notifications from new comments?
  • user110857
    user110857 over 3 years
    This still works on macOS Catalina 10.15.6!
  • spyderdyne
    spyderdyne over 3 years
    This is perfect. Thank you!
  • Doug
    Doug over 3 years
    this worked for me. Unfortunately, when using the macbook keyboard i will have to swap it back... :(