From: shah@fnsony.fnal.gov (Hemant Shah)
Newsgroups: comp.windows.x.apps
Subject: Re: Sun XT keyboard like VT100?
Date: 23 Jul 92 18:27:51 GMT
Reply-To: shah@fnalb.fnal.gov
Organization: Fermi National Accelerator Laboratory, Batavia, IL

In article <3503@sol.deakin.OZ.AU>, tim@mimas.cc.deakin.OZ.AU (Tim Cook) writes:
|> Has anyone out there configured their Sun XT style keyboard like a VT100
|> keyboard (at least as far as xterm is concerned)?  I know this would require
|> use of xmodmap and setting of XTerm resources, but I was wondering if anyone
|> out there has already done this and would therefore have an understandable
|> example/demonstration of how this is done.  I find the xterm manual page
|> just a bit lacking.

Here's the setup I use for SUN type 5 keyboard (XT style keyboard)

Add the following to your .Xdefault file

---- 8< ------- 8< ----- .Xdefaults BEGIN ---- 8< -------- 8< --------
myxterm*VT100.Translations: #override \
       <Key>BackSpace:          string("0x7f") \n\
       <Key>F1:                 string(0x1b) string("[17~") \n\
       <Key>F2:                 string(0x1b) string("[18~") \n\
       <Key>F3:                 string(0x1b) string("[19~") \n\
       <Key>F4:                 string(0x1b) string("[20~") \n\
       <Key>F5:                 string(0x1b) string("[21~") \n\
       <Key>F6:                 string(0x1b) string("[23~") \n\
       <Key>F7:                 string(0x1b) string("[24~") \n\
       <Key>F8:                 string(0x1b) string("[25~") \n\
       <Key>F9:                 string(0x1b) string("[26~") \n\
       <Key>F10:                string(0x1b) string("[28~") \n\
       <Key>Num_Lock:           string(0x1b) string("OP") \n\
       <Key>R1:                 string(0x1b) string("Ol") \n\
       <Key>R2:                 string(0x1b) string("[28~") \n\
       <Key>R3:                 string(0x1b) string("[29~") \n\
       <Key>R5:                 string(0x1b) string("OQ") \n\
       <Key>R6:                 string(0x1b) string("OR") \n\
       <Key>R7:                 string(0x1b) string("Ow") \n\
       <Key>R8:                 string(0x1b) string("Ox") \n\
       <Key>R9:                 string(0x1b) string("Oy") \n\
       <Key>R10:                string(0x1b) string("Ot") \n\
       <Key>R11:                string(0x1b) string("Ou") \n\
       <Key>R12:                string(0x1b) string("Ov") \n\
       <Key>R13:                string(0x1b) string("Oq") \n\
       <Key>R14:                string(0x1b) string("Or") \n\
       <Key>R15:                string(0x1b) string("Os") \n\
       <Key>Help:               string(0x1b) string("[28~") \n\
       <Key>Insert:             string(0x1b) string("[1~") \n\
       <Key>Home:               string(0x1b) string("[2~") \n\
       <Key>End:                string(0x1b) string("[5~") \n\
       <Key>Next:               string(0x1b) string("[6~") \n\
       <Key>Prior:              string(0x1b) string("[3~") \n\
       <Key>KP_Decimal:         string(0x1b) string("On") \n\
       <Key>KP_0:               string(0x1b) string("Op") \n\
       <Key>Delete:             string(0x1b) string("[4~") \n\
       <Key>KP_Subtract:        string(0x1b) string("OS") \n\
       <Key>KP_Add:             string(0x1b) string("Om") \n\
       <Key>KP_Enter:           string(0x1b) string("OM") \n\


---- 8< ------- 8< ----- .Xdefaults END ---- 8< -------- 8< --------

Here's the script (I call it vt100) I use to open up an xterm with 
vt100 emulation.

Use it as follows:

% vt100 node_name

or

% vt100

---- 8< ------- 8< ----- vt100 begin ---- 8< -------- 8< --------
#! /bin/sh
T="vt100 terminal"
if test $# -gt 0
then
        case $1 in
        -*)     ;;
        *)
                if test x"`nslookup $1 2>&1 1>/dev/null | \
                           grep 'Non-existent domain'`" != x
                then @*
                        E=""
                else
                        E="$1"
                        T="$1 $T"
                        shift
                fi
        esac
fi
if test x$E != x
then
   $OPENWINHOME/demo/xterm -132 -sb -sk -tn vt100 -fn 9x15bold\
    -T "$T" -fg black -bg wheat -ms red -cr black -s -j $*\
    -name myxterm -e sh -c "exec telnet $E" &
else 
   $OPENWINHOME/demo/xterm -132 -sb -sk -tn vt100 -fn 9x15bold\
   -name myxterm -T "$T" -fg black -bg wheat -ms red -cr black -s -j $* &
fi

---- 8< ------- 8< ----- vt100 end ---- 8< -------- 8< --------




-- 
-------------------------------------------------------------------------------
Hemant Shah                            | All the opinions expressed are my own
Fermi National Accelerator Laboratory  | and does not necessarily reflect
Systems Integration Group              | those of Fermilab.
E-mail :shah@fnal.fnal.gov             |
 Voice : (708) 840-8071	               | I haven't lost my mind
   Fax : (708) 840-2783                | it's backed on tape somewhere.
-------------------------------------------------------------------------------