Results 1 to 10 of 10

Thread: Apple key as Ctrl

  1. #1
    Join Date
    Nov 2006
    Beans
    23

    Apple key as Ctrl

    For the love of me, I can't figure out how to map the Apple key to act as CTRL on Xubuntu 8.10. "New" (for me) way of configuring hardware in it is a blah for me... don't know anything.

    Any pointers on remapping the CTRL key? I figured out how to do it in GNOME but I'm not using it...

    Previous gen Macbook.
    Last edited by herzzreh; October 27th, 2008 at 06:33 PM.

  2. #2
    Join Date
    Sep 2008
    Beans
    49

    Re: Apple key as Ctrl

    1. In console.

    Code:
    $ sudo dumpkeys | head -1 > /usr/share/keymaps/Ctrl2Command.map
    Then add the following line to that file:

    Code:
    Keycode 125 = Control
    Finish by referencing the new keymap to the KEYMAP variable in /etc/conf.d/keymaps. The keymaps boot script or the system will need to be restarted.

    Warning: Don’t change /etc/conf.d/keymaps and restart the init script (/etc/init.d/keymaps) if the X server is running! It’s best to work from console with no X server going.

    If you have 'loadkeys', you can use:

    Code:
    # loadkeys /usr/share/keymaps/Ctrl2Command.map
    2. In X11.

    In X Window you can use xmodmap(1) to change the keymaping. See its man page for more information.

    The X server has a list of known keyboard mappings in /usr/share/X11/xkb/rules/xorg.lst. From there I was able to map the Control key to Apple:

    Code:
        Option      "XkbOptions"    "altwin:ctrl_win"
    Last edited by paul_mcl; October 27th, 2008 at 07:20 PM.

  3. #3
    Join Date
    Nov 2006
    Beans
    23

    Re: Apple key as Ctrl

    Quote Originally Posted by paul_mcl View Post
    1. In console.

    Code:
    $ sudo dumpkeys | head -1 > /usr/share/keymaps/Ctrl2Command.map
    Then add the following line to that file:

    Code:
    Keycode 125 = Control
    Finish by referencing the new keymap to the KEYMAP variable in /etc/conf.d/keymaps. The keymaps boot script or the system will need to be restarted.

    Warning: Don’t change /etc/conf.d/keymaps and restart the init script (/etc/init.d/keymaps) if the X server is running! It’s best to work from console with no X server going.

    If you have 'loadkeys', you can use:

    Code:
    # loadkeys /usr/share/keymaps/Ctrl2Command.map
    2. In X11.

    In X Window you can use xmodmap(1) to change the keymaping. See its man page for more information.

    The X server has a list of known keyboard mappings in /usr/share/X11/xkb/rules/xorg.lst. From there I was able to map the Control key to Apple:

    Code:
        Option      "XkbOptions"    "altwin:ctrl_win"
    Thanks! Do I have to do 1 and 2 or is it 1 or 2?

  4. #4
    Join Date
    Sep 2008
    Beans
    49

    Re: Apple key as Ctrl

    >> Thanks! Do I have to do 1 and 2 or is it 1 or 2?

    If you're using primarily X11 (KDE/Gnome/XFCE/Enlightenment/etc.) and don't use console, do variant 2. If you're happy only with console (as I am), do variant 1. If you want total remap everywhere, do them both.

  5. #5
    Join Date
    Jun 2007
    Location
    USA
    Beans
    291
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Apple key as Ctrl

    Will this map both of the command keys? I found a fix, but it only maps the left one, the right is still dead.
    Macbook 2,1 2.16 Core 2 Duo / 2Gb Ram / 120Gb HDD: Ubuntu Studio 9.04 64 Bit/ Mac OS X 10.4.11

    Registered Linux User # 449355 / Registered Ubuntu User # 16921

  6. #6
    Join Date
    Nov 2006
    Beans
    23

    Re: Apple key as Ctrl

    Quote Originally Posted by paul_mcl View Post
    [B][I]1.

    2. In X11.

    In X Window you can use xmodmap(1) to change the keymaping. See its man page for more information.

    The X server has a list of known keyboard mappings in /usr/share/X11/xkb/rules/xorg.lst. From there I was able to map the Control key to Apple:

    Code:
        Option      "XkbOptions"    "altwin:ctrl_win"
    Using the whole hal deal, where do I put that XkbOptions now that xorg.config isn't used...?

  7. #7
    Join Date
    Nov 2006
    Beans
    23

    Re: Apple key as Ctrl

    Anything? Fix posted here I cannot get to work. Either it really doesnt work with 8.10 or I'm an idiot! Someone post a step-by-step, pls.

  8. #8
    Join Date
    Sep 2008
    Beans
    49

    Re: Apple key as Ctrl

    The following was taken from
    http://jyoseph.com/use-xmodmap-to-re...inum-keyboard/

    First, create a file in your home directory. Browse to /home/yourusername/ and create a file called .xmodmap. Open the file and paste in the following:

    Code:
    remove control = Control_L Control_R 
    keycode 115 = Super_L Super_L 
    keycode 116 = Super_R Super_R 
    add control = Super_L Super_R
    Now, open up terminal and type the following:

    Code:
    xmodmap ~/.xmodmap

  9. #9
    Join Date
    Nov 2006
    Beans
    23

    Re: Apple key as Ctrl

    Quote Originally Posted by paul_mcl View Post
    The following was taken from
    http://jyoseph.com/use-xmodmap-to-re...inum-keyboard/

    First, create a file in your home directory. Browse to /home/yourusername/ and create a file called .xmodmap. Open the file and paste in the following:

    Code:
    remove control = Control_L Control_R 
    keycode 115 = Super_L Super_L 
    keycode 116 = Super_R Super_R 
    add control = Super_L Super_R
    Now, open up terminal and type the following:

    Code:
    xmodmap ~/.xmodmap
    This does work but icky about loading it every time. Does anyone know how to load it each time X starts?

  10. #10
    Join Date
    Aug 2005
    Location
    Huntsville, AL, USA
    Beans
    7,526
    Distro
    Ubuntu

    Re: Apple key as Ctrl

    Quote Originally Posted by herzzreh View Post
    This does work but icky about loading it every time. Does anyone know how to load it each time X starts?
    add it to your session.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •