Subject: Re: Using the delete key to "right-delete" chars
To: None <netbsd-help@NetBSD.org>
From: James K. Lowden <jklowden@schemamania.org>
List: netbsd-help
Date: 10/01/2003 01:10:53
On Tue, 30 Sep 2003 23:48:06 +0200, "Ads" <ads@hitechplanet.com> wrote:
> 
> One feature that I like on some X apps (xdm, mozilla...), is the way
> they use the "Delete" key (above the directional pad) : it deletes the
> char that is on the right of the cursor position.
> 
> But I can't reproduce it on my NetBSD 1.6.1 system, and using the
> "Delete"

I can't help you, but I know it's not simple.  There are many
intermediaries between the "delete" key on your keyboard and what you see.
 I probably have some of this wrong, but for instance:

1.  /netbsd reads the raw scancode from the keyboard with wskbd(4).
2.  XFree86 reads wsdbd device, puts the key to the right pty.
3.  xterm is just a harness; the character is read by the foreground
process, oftentimes your shell.  

I'm sure I've left out some steps....

How the character is ultimately interpreted and acted on is up to the
application.  For instance, bash(1) will render your delete key as a
tilde, but vi won't.  And neither of them understands dead keys.  Cf.
http://wauug.erols.com/~balsa/linux/deadkeys/.  

It might be possible to do it right; Linux seems to.  I played with it for
awhile tonight, but I can't get bash to tell me its name for what arrives
when I press Delete.  Not knowing the name, I can't map it to delete-char.
 

AFAIK "delete the character under the cursor" is not a property of
terminals.  I think readline & Co. do more than map a keystroke to termcap
function.  

HTH.  :-/

--jkl