Backspace/Del mapping in Linux.

Backspace/Del mapping in Linux.

Post by Andrew Rakows » Sat, 12 Nov 1994 03:51:57



Quote:}---S0ren Ashe, on Nov  9, 11:24am,
}---Writing about "Backspace in seyon??" says (in part):{
...
} Does anybody know what I need to do to enable backspace in
} seyon and minicom?  Every time I press it, I get something
} which acts like a break or ^C.  ........................

...

I've noticed that Linux is set up to generate the DELete character when
the BackSpace key is pressed.  While not a problem with "local" use, it
is a pain when online to systems that have been set up with a rational
keymapping (ie: BackSpace=<backup and correct the last character>)
method.

I'd appreciate a pointer to an FAQ, FM, or README that explains exactly
where and how this BS=DEL is being mapped, and how to stop it from
doing this automatic conversion.  I've heard that this is done in some
kernel module, via Xmodmap (shouldn't apply to non-X though) and other
things, but I need more detail.  I *really* want the BackSpace key to
generate a BackSpace ASCII character.

BTW, this is something that is not just "X" related.  Running kermit
from a VC does the same thing.

What's really frustrating is that most comm packages (kermit, seyon,
etc.) are capable of doing this mapping IF YOU WANT IT...I just don't
want it, and want a normal keyboard, thank you very much!  8^)

---------------------------------------------------------------------------

---------------------------------------------------------------------------

 
 
 

Backspace/Del mapping in Linux.

Post by Robert Smi » Sat, 12 Nov 1994 09:50:52


: }---S0ren Ashe, on Nov  9, 11:24am,
: }---Writing about "Backspace in seyon??" says (in part):{
: ...
: } Does anybody know what I need to do to enable backspace in
: } seyon and minicom?  Every time I press it, I get something
: } which acts like a break or ^C.  ........................
: ...

try "stty erase ^h"

 
 
 

Backspace/Del mapping in Linux.

Post by Captain Sarcast » Sun, 13 Nov 1994 00:58:13


| This is currently being discussed on the KERNEL mailing list as well.
| Last word was: Linux console emulates vt240 keyboard as good as possible.

| I was able to prove by quoting from the DEC manuals the it is indeed the
| default behaviour to send the DEL character when the 'correction key' is
| pressed. Note that nowhere in the VT340  manual is a reference to a backspace
| key, such a thing apparently only exists on DOS-PC keyboards. :)

| So it looks like it will remain DEL. (But that's just my guess).

| If that bothers you just include the following line into your .profile:

|   stty erase '^H'

um...

When I switched from regular console usage to XDM, I ran itno the problem
where BS key killed tasks (intr) and so all I did was put "stty sane" in
/etc/profile and /etc/csh.cshrc and now everything is fine.

--

Study demonology with an enemy this Sunday.

 
 
 

Backspace/Del mapping in Linux.

Post by Dominik Kub » Sat, 12 Nov 1994 07:43:36


This is currently being discussed on the KERNEL mailing list as well.
Last word was: Linux console emulates vt240 keyboard as good as possible.

I was able to prove by quoting from the DEC manuals the it is indeed the
default behaviour to send the DEL character when the 'correction key' is
pressed. Note that nowhere in the VT340  manual is a reference to a backspace
key, such a thing apparently only exists on DOS-PC keyboards. :)

So it looks like it will remain DEL. (But that's just my guess).

If that bothers you just include the following line into your .profile:

  stty erase '^H'

but don't complain if emacs fires up help each time you press you 'backspace
key' ;-)

Cheers,
  Dominik
--
---------------------------------------------------------------------------

                                            55270 Ober-Olm, F.R. of Germany
Ask me about Linux International!           ******  European  Union  ******

 
 
 

Backspace/Del mapping in Linux.

Post by Jim Ocke » Mon, 14 Nov 1994 06:51:42



: : }---S0ren Ashe, on Nov  9, 11:24am,
: : }---Writing about "Backspace in seyon??" says (in part):{
: : ...
: : } Does anybody know what I need to do to enable backspace in
: : } seyon and minicom?  Every time I press it, I get something
: : } which acts like a break or ^C.  ........................
: : ...

: try "stty erase ^h"

If you use xmodmap the following code will turn your backspace
key into a ^H, under X:

keycode 22 = BackSpace

I put that line my my .Xmodmaprc and call xmodmap whenever I
log in.

I haven't figured out how to do that in a VC, but I'd think you
can use loadkeys to make a new keyboard map.  I need to try that,
now that I think of it...

--

PGP public key available upon request, or from my web pages.
GE d? p c++ l++ u++ e++ m++(--) s n-(+) h+ f !g w+ t+ r !y
<a href="http://www.umr.edu/~ockers/">home page</a>

 
 
 

Backspace/Del mapping in Linux.

Post by Mubashir Chee » Mon, 14 Nov 1994 17:02:16



>try "stty erase ^h"

Someone suggested :

reset > /dev/null

Whats the difference ?

Mubashir Cheema
Disclaimer : The views expressed above are my own personal views.

 
 
 

Backspace/Del mapping in Linux.

Post by Viktor T. To » Sun, 13 Nov 1994 20:16:14




>| This is currently being discussed on the KERNEL mailing list as well.
>| Last word was: Linux console emulates vt240 keyboard as good as possible.

>| I was able to prove by quoting from the DEC manuals the it is indeed the
>| default behaviour to send the DEL character when the 'correction key' is
>| pressed. Note that nowhere in the VT340  manual is a reference to a backspace
>| key, such a thing apparently only exists on DOS-PC keyboards. :)

>| So it looks like it will remain DEL. (But that's just my guess).

Now that's just splendid. I am really happy that Linux emulates the vt240
keyboard perfectly. However, unfortunately, I happen to have a PC keyboard
attached to my Linux machine. I know I am backward, using such a stupid thing
as a PC keyboard, but just in case I am not the only one, wouldn't it be nice
if Linux emulated a PC keyboard instead? <sigh>

Quote:>When I switched from regular console usage to XDM, I ran itno the problem
>where BS key killed tasks (intr) and so all I did was put "stty sane" in
>/etc/profile and /etc/csh.cshrc and now everything is fine.

stty settings go bonkers in xterms. I wonder if there is a 'proper' solution
for this, rather than putting stty in your profile which may not always be
what you want.

Viktor

 
 
 

Backspace/Del mapping in Linux.

Post by Gert Doeri » Tue, 15 Nov 1994 01:05:10



Quote:>Now that's just splendid. I am really happy that Linux emulates the vt240
>keyboard perfectly. However, unfortunately, I happen to have a PC keyboard
>attached to my Linux machine. I know I am backward, using such a stupid thing
>as a PC keyboard, but just in case I am not the only one, wouldn't it be nice
>if Linux emulated a PC keyboard instead? <sigh>

Well, not very useful, considering that PC keyboards usually sends scan
codes, which would *really* confuse portable programs.

[..]

Quote:>stty settings go bonkers in xterms. I wonder if there is a 'proper' solution
>for this, rather than putting stty in your profile which may not always be
>what you want.

What about the X ressources?

gert
--
Yield to temptation ... it may not pass your way again!  --  Lazarus Long
                                                            //www.muc.de/~gert


 
 
 

Backspace/Del mapping in Linux.

Post by Viktor T. To » Tue, 15 Nov 1994 11:12:54



>As far as xterms go, try taking a look at the xterm man page and look at
>ttyModes. You can put a line like this in you .Xdefaults
>        xterm.ttyModes: erase "^H" kill "^U" intr "^C" susp "^Z" ... [etc]
>then do an
>        xrdb -merge .Xdefaults
>This should fix your xterm problems.  To set it systemwide just edit
>Xdefaults (I can't remeber where it is right now..sigh)

I did what you suggested; actually, edited /usr/X11/lib/X11/app-defaults/XTerm.
Guess it's my turn to RTFM :-). Still, I wonder where those weird settings
came in the first place; I believe I have seen these settings in non-X rsh
sessions sometimes, too.

Anyways, thanks for the suggestion!

Viktor

 
 
 

Backspace/Del mapping in Linux.

Post by Mark Lo » Wed, 16 Nov 1994 11:43:09


<
<I'd appreciate a pointer to an FAQ, FM, or README that explains exactly
<where and how this BS=DEL is being mapped, and how to stop it from
<doing this automatic conversion.  I've heard that this is done in some

Change the keymapping by invoking the following script from /etc/rc.d/rc.local:

#!/usr/bin/loadkeys
# Make BackSpace key send a BS, and make Delete key send a DEL
keycode  14 = BackSpace        Delete          
        control keycode  14 = Delete          
        alt     keycode  14 = Meta_Delete    
keycode 111 = Delete           Remove           Remove          
        control keycode 111 = Remove          
        shift   control keycode 111 = Remove          
        alt     keycode 111 = Remove          
        control alt     keycode 111 = Boot            
--

 
 
 

Backspace/Del mapping in Linux.

Post by Steve Whorwo » Tue, 15 Nov 1994 16:10:06



Quote:>If you use xmodmap the following code will turn your backspace
>key into a ^H, under X:
>keycode 22 = BackSpace
>I put that line my my .Xmodmaprc and call xmodmap whenever I
>log in.
>I haven't figured out how to do that in a VC, but I'd think you
>can use loadkeys to make a new keyboard map.  I need to try that,
>now that I think of it...

I've just been hacking at a keymap for loadkeys to get over the
backspace/delete anomaly, and in the process discovered another.

The backspace key (14 on the Uk map, as shown by showkey -k) was mapped
to Delete, the delete key was mapped to Remove ( defined as :-
string Remove = "\033[3~" in the map). Backspace, although supported by
the kernel, was nowhere to be seen.

My problem was with crisp2.2e's keyboard handling of bs/del. I finally
settled om mapping keycode 14 to BackSpace, shift 14 to Delete and 111 to
Delete. It still breaks some packages that expect a backspace to be sent
as Delete, but shift backspace works as before.

>--

>PGP public key available upon request, or from my web pages.
>GE d? p c++ l++ u++ e++ m++(--) s n-(+) h+ f !g w+ t+ r !y
><a href="http://www.umr.edu/~ockers/">home page</a>

--
Steve Whorwood

 
 
 

Backspace/Del mapping in Linux.

Post by Paul Si » Tue, 15 Nov 1994 01:32:39


#
#  This is a patch to fix the strange mapping of backspace
#  and delete on linux.  To apply this patch do the following.
#
#  Save this file as /tmp/patch.defkeymap (or a name of your
#                                          choice.)
#
#  cd to the parent directory of your linux source.  In most
#  cases this is /usr/src.
#
#  patch -p0 </tmp/patch.defkeymap
#
#  cd linux/drivers/char
#
#  loadkeys --mktable defkeymap.map > defkeymap.c
#
#  cd ../..
#
#  "make" your linux kernel.
#
#    typically,
#
#        make zImage
#        make zlilo
#
#    If you are unsure of this step, follow the README in the
#    linux directory.
#
#  If you are terrified of rebuilding the kernel, you can install
#  the keymap as part of your startup (or any other time) by
#
#  loadkeys /usr/src/linux/drivers/char/defkeymap.map
#
#
--- linux/drivers/char/defkeymap.map.orig       Sat Jan  8 12:35:07 1994

        alt     keycode  12 = Meta_minus      
 keycode  13 = equal            plus            
        alt     keycode  13 = Meta_equal      
-keycode  14 = Delete           Delete          
-       alt     keycode  14 = Meta_Delete    
+keycode  14 = BackSpace        BackSpace          
+       alt     keycode  14 = Meta_BackSpace    
 keycode  15 = Tab              Tab            
        alt     keycode  15 = Meta_Tab        

 keycode 109 = Next            
        shift   keycode 109 = Scroll_Forward  
 keycode 110 = Insert          
-keycode 111 = Remove          
+keycode 111 = Delete          
        altgr   control keycode 111 = Boot            
        control alt     keycode 111 = Boot            
 keycode 112 = Macro          

--
Paul Sitz                                                          
Empros Power Systems Control
A Division of Siemens Energy & Automation, Inc.

Plymouth, MN  55441-3694           screammail:     (612) 553-4516

 
 
 

Backspace/Del mapping in Linux.

Post by Jeffery Benshetl » Tue, 15 Nov 1994 10:29:23


[...much deleted : SAVE THE BANDWIDTH!]
: >When I switched from regular console usage to XDM, I ran itno the problem
: >where BS key killed tasks (intr) and so all I did was put "stty sane" in
: >/etc/profile and /etc/csh.cshrc and now everything is fine.

: stty settings go bonkers in xterms. I wonder if there is a 'proper' solution
: for this, rather than putting stty in your profile which may not always be
: what you want.

As far as xterms go, try taking a look at the xterm man page and look at
ttyModes. You can put a line like this in you .Xdefaults
        xterm.ttyModes: erase "^H" kill "^U" intr "^C" susp "^Z" ... [etc]
then do an
        xrdb -merge .Xdefaults
This should fix your xterm problems.  To set it systemwide just edit
Xdefaults (I can't remeber where it is right now..sigh)

                --Jeffery Benshetler

--
**********************************************************************
                Jeffery "TheBull" Benshetler

**********************************************************************

 
 
 

1. HELP: backspace & del not mapped correctly under X

Greetings,
    I have set up a system (actually 7) with X, and I would like to
have the backspace and delete keys working properly under X.  Now I
know I am opening a can of worms when I say `properly', but it was my
notion that backspace deletes the char to the left of the cursor,
whereas the del key deltes under the cursor.

Currently they both delete to the right for applications such as
netscape (entering urls), but work fine for xterms.  Is there a way to
get the consistent behavior described above for all apps under X??
Any help would be greatly appreciated!

TIA,

jas

Jason Temple

2. Virtual display..

3. backspace, del keys mapping

4. Multiple Solaris CD dist -> Single DVD?

5. Konsole and <ins> <del> keys

6. Extreme Newbie Questions

7. Backspace and Del

8. neil@themessage.com

9. Can't get [Backspace] key to register ASCII DEL

10. BACKSPACE & DEL keys on remte systems

11. Backspace = DEL ... how to change

12. Need help switching DEL & BACKSPACE keys

13. Backspace acts like "Del" key