Change behavior of Control key on Ubuntu with Mac keyboard

10,268

Solution 1

Keep in mind that the Command key is the same as the Windows key (or Super) in Bootcamp/whatever.

  1. Back up. Santa will thank you.
  2. Read this guide and this guide if you want to get a basic idea of what I'm doing in step 3.
  3. Add these two commands to your startup (System->Administration->Startup Applications):

    xmodmap -e 'keycode 133=Control_L'
    xmodmap -e 'keycode 37=Super_L'
    

    That'll take care of the left side, swapping the Command and Control key functions.

  4. Add these two commands to your startup too for the right command and control.

    xmodmap -e 'keycode 134=Control_R'
    xmodmap -e 'keycode 109=Super_R'
    

It'll only work as soon as you log in though.

Solution 2

You can also set this in the GUI:

Go into System -> Preferences -> Keyboard

Click on the "Layouts" tab and then click the "Layout Options" button.

Click on "Alt/Win key behavior"

Select "Control is mapped to Win keys (and the usual ctrl key).

from http://ubuntuforums.org/showthread.php?t=1293081

Share:
10,268

Related videos on Youtube

Wuffers
Author by

Wuffers

Ohai

Updated on September 17, 2022

Comments

  • Wuffers
    Wuffers over 1 year

    On Ubuntu 10.10, is there any way to change the keyboard layout to where the Command key acts like the Control key?

    And, if hardware makes any difference, I am on a 13" Aluminum Late '08 MacBook.

    • Victor S
      Victor S about 12 years
      Ditto for 11.10
  • Wuffers
    Wuffers over 13 years
    Thanks for the answer! I'll try this as soon as I get the chance! (Computer is getting fixed x_x)
  • digitxp
    digitxp over 13 years
    If you open a terminal and run any pair of commands does it work?
  • Wuffers
    Wuffers over 13 years
    @digitxp: I tried that and that doesn't work, either.
  • digitxp
    digitxp over 13 years
    Hm...that's tough. Does the Command key act like a Super key (quick way to check is to hit Cmd+E and again. If it works it'll show the multiple desktops view and return to normal view)
  • Wuffers
    Wuffers over 13 years
    @digitxp: I tried that and it didn't work, so I guess the command key isn't working at all...
  • digitxp
    digitxp over 13 years
    That could be it then.