Results 1 to 8 of 8

Thread: HOW-TO: Swap Caps Lock and Escape

  1. #1
    Join Date
    Oct 2006
    Beans
    63

    HOW-TO: Swap Caps Lock and Escape

    Swapping Caps Lock and Escape can be very helpful, especially for vim users, as it reduces stress on your fingers.

    Instructions for Gnome:
    1. System -> Preferences -> Keyboard
    2. Select Layouts tab, then Layout Options
    3. Click on 'CapsLock key behavior'
    4. Click on 'Swap ESC and CapsLock'

    That's it.

  2. #2
    Join Date
    Feb 2006
    Beans
    27

    Re: HOW-TO: Swap Caps Lock and Escape

    This works except for the annoying fact that the CapsLock light is still being governed by actual CapsLock presses instead of ESC presses (which would make more sense after the remapping). Is there anyway to get the ESC to control the CapsLock light!? this would seem to be a bug? where would I report it?

    My ESC/CapsLock journey thus far for anyone interested in a tale of triumph and tragedy:
    I actually had this working properly in Gutsy after some hack on the key mapping files I picked up from a random blog, but boy did that screw up my Hardy upgrade-- I was stuck with permanent CapsLock anytime I happened to touch that button (which by that time had become my muscle-memory's ESC button). All my letters were all caps forever until a full reboot. So then I decided to install Hardy from scratch, in hopes that this nice little option would work correctly. Mostly-- but not quite.

  3. #3
    Join Date
    Jan 2006
    Beans
    325

    Re: HOW-TO: Swap Caps Lock and Escape

    Quote Originally Posted by timo1023 View Post
    Swapping Caps Lock and Escape can be very helpful, especially for vim users, as it reduces stress on your fingers.

    Instructions for Gnome:
    1. System -> Preferences -> Keyboard
    2. Select Layouts tab, then Layout Options
    3. Click on 'CapsLock key behavior'
    4. Click on 'Swap ESC and CapsLock'

    That's it.
    I wonder if there's a way to, instead of *swapping* the keys, have *both* be escape. This aids in the learning the new key position in, for example, 'vi'. When they are swapped, I still keep pressing the real 'esc' key, but it does a caps lock, which is really annoying in 'vi'.

    Any idea how to do that?

    Max.

  4. #4
    Join Date
    Feb 2005
    Location
    Colorado
    Beans
    16
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: HOW-TO: Swap Caps Lock and Escape

    Quote Originally Posted by davidmaxwaterman View Post
    I wonder if there's a way to, instead of *swapping* the keys, have *both* be escape. This aids in the learning the new key position in, for example, 'vi'. When they are swapped, I still keep pressing the real 'esc' key, but it does a caps lock, which is really annoying in 'vi'.

    Any idea how to do that?
    Under 9.04 one of the keyboard and layout options instead of "Swap ESC and CapsLock" is "Make CapsLock an additional ESC" which does the trick.

  5. #5
    Join Date
    Nov 2005
    Beans
    9

    Re: HOW-TO: Swap Caps Lock and Escape

    Quote Originally Posted by jonatin View Post
    Under 9.04 one of the keyboard and layout options instead of "Swap ESC and CapsLock" is "Make CapsLock an additional ESC" which does the trick.
    For me, this option Makes CapsLock an ESC key, and makes ESC do nothing at all. Any ideas on what might be causing that?

  6. #6
    Join Date
    Jan 2006
    Beans
    325

    Re: HOW-TO: Swap Caps Lock and Escape

    Quote Originally Posted by dvhart View Post
    For me, this option Makes CapsLock an ESC key, and makes ESC do nothing at all. Any ideas on what might be causing that?
    Same for me. :/

  7. #7
    Join Date
    Nov 2005
    Beans
    9

    Re: HOW-TO: Swap Caps Lock and Escape

    Quote Originally Posted by davidmaxwaterman View Post
    Same for me. :/
    I spent TOO LONG looking into this. Turns out the gnome-keyboard-preferences tool uses XkbOptions via the /etc/init.d/console-setup script and uses /etc/default/console-setup for configuration if you Apply Globally. To make the option work as described in the GUI (making caps lock an ADDITIONAL Escape key - not the ONLY one) you need to edit the Xkb config file here:

    /usr/share/X11/xkb/symbols/capslock

    as follows:

    xkb_symbols "escape" {
    key <CAPS> { [ Escape ] };
    key <ESC> { [ None ] }; <-- delete this
    };

    So I found the fix, can someone else open a bug? We should either change the description in the gui tool, or change the xkb file as above (I prefer the latter). I'll try to open a bug if no-one else gets around to it.

  8. #8
    Join Date
    Jul 2009
    Beans
    7

    Re: HOW-TO: Swap Caps Lock and Escape

    Quote Originally Posted by dvhart View Post
    So I found the fix, can someone else open a bug? We should either change the description in the gui tool, or change the xkb file as above (I prefer the latter). I'll try to open a bug if no-one else gets around to it.
    Thank you very much, amazing find, I love it, makes vim even better imho.

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
  •