SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2011-07-05 12:09:37

MekkaGodzilla
Member
From: Lyon, France
Registered: 2011-07-02
Posts: 18

[Solved] Use Caps Lock key as another Esc

Hello there,
Does anybody know the trick to use Caps Lock as another Escape key? It’s quite handy for vi.
Thanks,
Phil

Last edited by MekkaGodzilla (2011-07-05 14:57:27)

Offline

Help fund CrunchBang, donate to the project!

#2 2011-07-05 12:56:08

machinebacon
#! unstable
From: China
Registered: 2009-07-02
Posts: 6,826
Website

Re: [Solved] Use Caps Lock key as another Esc

Hi Phil,

this would be a task for xmodmap. You can use 'xev' in terminal to find out the code of Caps Lock. (keycode 66). Then make a copy of .Xmodmap for your user only:

xmodmap -pke > .Xmodmap 

Edit this file with an editor of your choice (vi) big_smile
You can now change the line

66 = Caps_Lock NoSymbol Caps_Lock

to

66 = Escape NoSymbol Caps_Lock

In this case you could have the real Caps Lock function if you press Alt + Caps Lock.
Save the file, and run

xmodmap .Xmodmap

at startup. Control if you did everything right with xev.


Sweaty lads picking up the soap | I love the new "Ignore user" button

Offline

#3 2011-07-05 14:06:29

MekkaGodzilla
Member
From: Lyon, France
Registered: 2011-07-02
Posts: 18

Re: [Solved] Use Caps Lock key as another Esc

Hi,
Thanks for the tutorial.
For some reason Caps Lock now works as an Escape key but kept ITS ORIGINAL FUNCTION AS WELL.
What to do?

Offline

#4 2011-07-05 14:48:41

machinebacon
#! unstable
From: China
Registered: 2009-07-02
Posts: 6,826
Website

Re: [Solved] Use Caps Lock key as another Esc

maybe

66 = Escape Escape Escape


Sweaty lads picking up the soap | I love the new "Ignore user" button

Offline

#5 2011-07-05 14:56:56

MekkaGodzilla
Member
From: Lyon, France
Registered: 2011-07-02
Posts: 18

Re: [Solved] Use Caps Lock key as another Esc

Same thing unfortunately…
But I found a way to kill the caps lock function when setting my keyboard layout in my autostart.sh file :

setxkbmap fr bepo -option ctrl:nocaps &

Replace fr bepo with your layout of choice of course.

So problem solved tongue

Offline

#6 2011-07-05 15:06:07

machinebacon
#! unstable
From: China
Registered: 2009-07-02
Posts: 6,826
Website

Re: [Solved] Use Caps Lock key as another Esc

in case somebody cares:
add

clear Lock

as very first line in .Xmodmap, at least here it works smile anyway, solved is solved big_smile


Sweaty lads picking up the soap | I love the new "Ignore user" button

Offline

#7 2014-12-01 15:39:37

gurflob
New Member
Registered: 2014-11-23
Posts: 7

Re: [Solved] Use Caps Lock key as another Esc

If I use "clear Lock", will bringing caps lock back be as easy as removing that line and restarting? Or do I have to somehow add Lock back in?

Offline

#8 2015-04-28 06:45:02

ubuntulistener
New Member
Registered: 2009-05-10
Posts: 3

Re: [Solved] Use Caps Lock key as another Esc

in case someone comes looking for an answer:  in /etc/default/keyboard    change XKBOPTIONS=""   to    XKBOPTIONS="caps:swapescape"  ...save and reboot

credit where credit is due: http://forums.debian.net/viewtopic.php?f=5&t=82079

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: acrobat

Debian Logo