You are not logged in.

#1 2008-03-24 11:19:04

jakobm
Member
Registered: 2008-03-24
Posts: 132

Disable Escape key

I want do disable my Escape key (due to a hardware defect) and use the Caps lock key instead.

There exists a vast of tips how to map Escape to Caps lock, but what I want is:
* disable Escape key completely (because it's pressed randomly, tea accident, laptop keyboard)
* change the keymap files (create a new) under /usr/share/kbd/keymaps, not only use xmodmap

I'm from Germany and use the de-latin1-nodeadkeys map.
I tried the following:

# jakob.map: disable Escape and map Escape to Caps lock

include "de-latin1-nodeadkeys.map"

keycode 1 =
keycode 58 = Escape

But this does not disable the Escape key.

So, how can I completely disable that key?
Further questions:
* the Caps lock LED on my keyboard is still turning on and off, although it's now an Escape key -- is there a chance to change this behavior?
* can I change the current keymap while running, or do I have to put the name in rc.conf and reboot?

Offline

#2 2008-03-24 12:19:24

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: Disable Escape key

You can set X keymap with setxkbmap.

You can remove lock with 'remove Lock = Caps_Lock' in xmodmap. Look for xkbd equivalent.

(that's for X, not vc)

Last edited by lucke (2008-03-24 12:21:08)

Offline

#3 2008-03-24 16:04:32

jakobm
Member
Registered: 2008-03-24
Posts: 132

Re: Disable Escape key

Hello lucke,

thanks for your response but it doesn't help me, because
(1) first it does not disable the Escape key and
(2) second I often work without X so I need the key change under virtual console, too.

Offline

#4 2008-03-24 16:51:27

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: Disable Escape key

Look at /usr/share/kbd/keymaps/i386/colemak/colemak.map.gz - it disables Capslock lock and puts Backspace there instead. Seems that binding backspace (escape in your case) to key 58 is enough in kbd's case (kbd is vc, xkdb/xmodmap is X).

I'm not sure if disabling esc is possible, but perhaps you might try binding scrollock or numlock to it (if it doesn't break anything for you).

Offline

#5 2008-03-24 18:12:59

carlocci
Member
From: Padova - Italy
Registered: 2008-02-12
Posts: 368

Re: Disable Escape key

jakobm wrote:

* can I change the current keymap while running, or do I have to put the name in rc.conf and reboot?

loadkeys: it is invoked by rc.sysinit

status "Loading Keyboard Map: $KEYMAP" /bin/loadkeys -q -u $KEYMAP

As for your problem you could try to remap esc to some useless key like scroll lock as it's already been suggested.
I think loadkeys replaces the default key bindings made at boot by the kernel, so ESC is mapped to ESC because the standard american keyboard is like that and you have to specify explicitly to remove a binding, so leaving keycode 1 blank simply doesn't replace the value.

Offline

#6 2008-03-24 22:41:58

jakobm
Member
Registered: 2008-03-24
Posts: 132

Re: Disable Escape key

Thanks! I finally solved it the way you propsed:

My new keymap:

$ zcat jakob.map.gz 
include "de-latin1-nodeadkeys.map"

keycode 1 = Num_Lock
keycode 58 = Escape

And the X equivalent:

$ cat .Xmodmap
clear lock
keycode 113 = Mode_switch
keycode 9 = Num_Lock
keycode 66 = Escape

smile

Last edited by jakobm (2008-03-25 10:02:30)

Offline

Board footer

Powered by FluxBB