Subject: Re: i386 xterm key bindings
To: None <,>
From: Greg A. Woods <>
List: current-users
Date: 07/25/2000 14:12:48
[ On Tuesday, July 25, 2000 at 13:14:09 (-0400), Brian A. Seklecki - Stargate Industries, LLC - NOC wrote: ]
> Subject: Re: i386 xterm key bindings
> What about mapping some other keys?  On some terminal emulators I use,
> I've got certain non alpha-numeric keys mapped to send special ASCII
> Control Codes.

Why not just fix the X mappings directly in the first place and not have
to worry about how all the different ways different applications,
including termios, want this stuff specified?

This is very easy to do using xkeycaps.  The only problem I've had so
far is with Netscape not honouring the asciitilde mapping I set.

I use the following xmodmap input to turn my NCD108 (vt220-style)
keyboard back into something more like my Sun Type-4 keyboard (which is
almost as perfect as the keyboard on my old DMD 5620 terminals! ;-)

! This is an `xmodmap' input file for NCD N108 (US) keyboards.
! Automatically generated on Thu Mar 30 12:28:59 2000 by woods with
! XKeyCaps 2.44; Copyright (c) 1999 Jamie Zawinski <>.
! This file presupposes that the keyboard is in the default state, and
! may malfunction if it is not.
remove Lock    = Caps_Lock
remove Control = Control_L

keycode 0x10 =	F1	Pause
keycode 0x27 =	F5	Break
keycode 0x0A =	F11	Escape
keycode 0x0B =	F12	BackSpace
keycode 0x0C =	F13	Linefeed
keycode 0x0E =	Escape	asciitilde
keycode 0x66 =	BackSpace	Delete
keycode 0x64 =	Home
keycode 0x5A =	Return	Linefeed
keycode 0x65 =	Delete	Select
keycode 0x84 =	KP_Subtract	KP_Divide
keycode 0x11 =	Caps_Lock
keycode 0x14 =	Control_L
keycode 0x7C =	KP_Add	KP_Multiply
keycode 0x09 =	grave	asciitilde
keycode 0x79 =	KP_Enter	Linefeed
keycode 0x78 =	Control_R

add    Lock    = Caps_Lock Caps_Lock
add    Control = Control_L Control_R

As for when you're not using X, well, the following almost works for me
on -current with wscons (I put this in /etc/rc.d/wscons):

        # fix the backspace key so it sends a backspace....
	# NOTE: this only seems to work sometimes and it definitely
	# doesn't work if you try to run screenblank....
        wsconsctl -w map+='keycode 14 = Cmd_ResetEmul BackSpace Delete' > /dev/null

        echo -n 'fixing keyboard map... '
        # PC Keyboard layouts are *all* insane....
        wsconsctl -w encoding=us.swapctrlcaps

I really really really do want to fix the wscons code properly though so
that when you ask for vt100 emulation that you get a proper backspace
key not this "stupid" vt220 nonsense!  ;-)  I just haven't found the
right place to do this yet!

							Greg A. Woods

+1 416 218-0098      VE3TCP      <>      <robohack!woods>
Planix, Inc. <>; Secrets of the Weird <>