What I do is make the DELETE key generate ASCII DEL, and the BACKSPACE
key generate ASCII BS (just as on my Sun type-4 keyboard in native
SunOS, and as on most sane real terminals, the totally *insanse* DEC
VT220 series aside).
Then things fall together relatively quickly, except for emacs users
such as myself who need a bit of glue for their ~/.emacs so that
BACKSPACE doesn't do what HELP should/does do. Being an orthogonal kind
of guy I generally go one step further in emacs (and similar interfaces)
and bind "DELETE" to delete the character in front of the mark
(i.e. under the cursor), just like Ctrl-D does.
Now of course if you want to go the other way around and follow the
VT220 down the path of incompatible insanity, as it seems you've
indicated, then you should be able to do pretty much the opposite of
what I do, or rather do almost nothing since that's the default wscons
configuration, and be equally happy! ;-)
> At least over an rlogin or telnet session? It looks to me as if
> someone designed a kludge that works for X, but simply didn't think
> about interoperating over Telnet/rlogin streams, or non-X screen-aware
> apps run in an xterm.
I'm not sure exactly what you mean -- if you re-bind the keys with
xmodmap (eg. with something generated by pgksrc/x11/xkeycaps) then
you'll get the proper bindings in xterm and thus in any [rs]login or
telnet session you open from any xterm. Besides my diskless Sun sparc
workstations running X11 I also have some NCD X terminals and they by
default have the naughty VT220 style keyboards. I re-map their
keyboards in /etc/X11/xdm/Xsetup with an xkeycaps designed file (and
of course I re-label the keycaps which indelible marker) and the only
problem I've had is with Netscape not accepting one of the remappings
for '~'. The key that's in the position of the BACKSPACE key generates
an ASCII BS key in an xterm and all is well....
I've not yet run X11 with my wscons fix in place, so I don't know if
it's 100% perfect yet, i.e. whether or not the X server will pick up the
default keyboard mapping from wscons, but it better be! ;-)
> If the current setup doesn't acutally support that, then I propose we
> back out the keybinding changes to xterm, and submit a pullup request
> to do the same in 1.5. At least until someone fixes the current bugs.
I'd strongly suggest that if "emul=vt100" in /etc/wscons.conf then the
keyboard map should match a real VT100, and only if it's "vt220" should
the keyboard map by default do the stupid "BACKSPACE=DEL" nonsense that
the damn vt220 line of terminals have perpetuated.
I'll be *extremely* upset if the default bindings of anything
(i.e. xterm or the console or whatever) change on NetBSD/sparc!
--
Greg A. Woods
+1 416 218-0098 VE3TCP <gwo...@acm.org> <robohack!woods>
Planix, Inc. <wo...@planix.com>; Secrets of the Weird <wo...@weird.com>
It is a good thing you're not using NetBSD/i386 with a PS/2 _and_ USB
keyboard! Backspace ("<-") on the PS/2 keyboard generates '^?' while
the USB keyboard generates '^H' for the very same key.
Talk about confusing! I can't switch back and forth (why would I want
to you ask?) without having to do an 'stty erase <-' each time. :(
Why this is I can not say, for brighter minds than mine have lit the
way.
-Andrew
--
-----------------------------------------------------------------
Andrew Gillham | NetBSD ist Affengeil.
gil...@whirlpool.com | Nachts ist es kaelter
I speak for myself, not for my employer. | als draussen.
>Don't forget though that the VT52 and VT100 (and VT101 and the
>decwriter-III and other similar keyboards) had both a normal backspace
>key *and* the delete key in approximately the "correct" places, so from
>a layout perspective there's no real preference on those physical
>models.
Sure. and the sun type-4 keyboard (tho' I occasionall mapped backspace
to delete there, too: as a reach issue).
[...]
>I think it should work the vt220-way by default if my experience is
>anything to go by, though as I say I've not yet run X11 on the console
>either with or without my wsconsctl tweaks in place.
xterm *used* to work the vt220-ish way, after the xmodmap, but now it
doesn't. That renders the 1.4.x systems i have in the lab close to
unusable ~unusuable via rlogin/telnet. it usuable.
If nobody suggests a fix (after the US long weekend), I propose to
back out the change, plus any corresponding changes to termcap.
>Hmmm... OK, interesting.
>
>what is happening then?
#1. I do the xmodmap thing I posted earlier.
#2. I rlogin to a system running 1.4.x of uncertain vintage.
#3. I start emacs.
#4. when I press the hey labeleld <-, it sends esc-[-3-~ over
the rlogin session.
#5. emacs (more or less correctly) interprets this as a _keypad_-delete,
which is (per PC usage) mapped to delete-right
(emacs fucntion delete-baclward-char; deletes character under cursor,
not the char to the left of the cursror).
All I wanted is that the key I have xmodmapped the keysym "Delete" to
generate ASCII DEL, like it does on a vt100. As X11 has supported
since, oh, X11R3 or thereabouts. I wouldn't have expected that was
too much to ask for.
...and every other ASCII CRT out there that wasn't made by DEC, or made to
be compatible with DEC.
I have two aliases on some system to cope with that:
alias ^H='stty erase ^H'
alias ^?='stty erase ^?'
(not cut-paste-able) so I only have to hit the <- key and enter to make
it the erase key. I stole this idea from somebody else though, and it
may not work in all shells if they are strict about alias names.
-Olaf.
--
___ Olaf 'Rhialto' Seibert - rhialto@polder -- Ah only did well at school
\X/ land.nl -- tae git intae an O level class tae git away fae Begbie.
Hi! I am a .signature virus. Copy me into your .signature to help me spead.
I have a pico/bash keymap on my machine at work that has the following
setup:
Key: "Home Key"
Use: "Move to beginning of line"
Ctrl: "^A"
Dec: "1"
Hex: "0x01"
Oct: "\001"
Key: "End Key"
Use: "Move to end of line"
Ctrl: "^E"
Dec: "5"
Hex: "0x05"
Oct: "\005"
Key: "Home Key"
Use: "Move to beginning of line"
Ctrl: "^A"
Dec: "1"
Hex: "0x01"
Oct: "\001"
Key: "Page Up"
Use: "Scroll One Page Up"
Ctrl: "^Y"
Dec: "25"
Hex: "0x19"
Oct: "\031"
[page down as well]
I have quiet a few others as well. The point is that these key binding
are extremely convenient when it comes to navigation. Those 6 keys are
there on a US 101 keyboard, but are un-unutilized by most applications by
default. And then there is the issue of the unused 12? keys on the right
side of a Sun keyboard.
Is there anyway to map these keys in an Xterm to send the above mentioned
ASCII codes?
-Brian