File:  [NetBSD Developer Wiki] / wikisrc / tutorials / how_to_swap_cap_lock_with_escape.mdwn
Revision 1.2: download - view: text, annotated - select for diffs
Sun Feb 5 07:14:36 2012 UTC (2 years, 2 months ago) by schmonz
Branches: MAIN
CVS tags: HEAD
dos2unix

#  Esc <-> Caps 

The original Unix terminals (or at least the one vi(1) written on) had the esc key somewhere around the tab on PC keyboards. This makes sense if you think about vi's commands. 

Well, we need tab, but most of us don't use the caps key, so we can just swap them right away. 

You only need to create a file with this content: 
    
    ! Swap caps lock and escape
    remove Lock = Caps_Lock
    keysym Escape = Caps_Lock
    keysym Caps_Lock = Escape
    add Lock = Caps_Lock
    

Or you can just have them both as an Escape key. 
    
    ! Making caps acting as esc
    remove Lock = Caps_Lock
    keysym Caps_Lock = Escape
    

You can save it to a file something like .swapesc and call it from .xinitrc: 
    
    xmodmap ~/.swapesc

CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb