[comp.sys.apollo] twm & apollo keys

gah@CML.UNL.EDU (Glen A. Hansen) (04/17/91)

I am presently running x11r4 @ SR10.3 on a network of Apollo's, using
twm as a window manager. I have some questions concerning twm and xterm:

  1) Has anyone had any success defining the Apollo DM keys (Pop,
     Again, Cut, etc.) to operate in twm, and/or in an xterm?
     I can define the "white" and function keys easily (in .twmrc and
     xmodmap), but have had no success with the DM keys. If this is
     not possible with the MIT distribution, is it possible to modify
     the source easily? (I have noticed that the key "F1" corresponds
     to 0xffbe, and "Pop" is 0x1000ff0e; is this just a matter of
     changing the size of the relevent variables?).

  2) Or, do I have to switch to gwm? On this note, does anyone have
     the necessary startup/config files developed that they would
     share with me? What are your feelings about gwm vs. twm?

Thanks in advance,

          gah@cml.unl.edu

rees@dabo.citi.umich.edu (Jim Rees) (04/17/91)

In article <9104171236.AA00634@cml.unl.edu>, gah@CML.UNL.EDU (Glen A. Hansen) writes:

    1) Has anyone had any success defining the Apollo DM keys (Pop,
       Again, Cut, etc.) to operate in twm, and/or in an xterm?

I've had some limited success at this.  Here are two entries from the FAQ
file (available by ftp from dabo.citi.umich.edu) about X keys.

Question:

Are the VT100 PF1-PF4 keys defined in the Apollo version of xterm?  If so,
where are they?  If not, can someone give me a hint how to define them (or
how to redefine any key for that matter).

 -- John A. Breen

Answer:

The manual "Using the X Window System on Apollo Workstations" is the place
to look for some of this -- it's a good summary, but not an exhaustive
treatise on X.  The answer to your question is that you will need to use the
client "xmodmap" in order to simulate the keys which are not physically
present on the Apollo keyboard (PF1-PF4 as an example).

Since you are running in a "dm owns root" configuration, you'll need to take
into account the "keyboard.config" file which tells XApollo "this list of
keys doesn't exist for X, pass them through to the Apollo Display Manager".
This is important because you don't want to remap keys for xterm which
XApollo will not GIVE to xterm. See section 2.2.2 in the manual for a
detailed discussion about the /usr/lib/X11/keyboard/keyboard.config file.

Once you have picked a set of physical keys to emulate the PF keys, feed
this to xmodmap using the physical keycode and the keysym name (from the
include file /usr/include/X11/keysymdef.h).

Example - you want to make the "AGAIN" key map to PF1.  Looking at the
output of "xmodmap -pk" you see that it is labeled "Redo" (which agrees with
the entry in the keyboard.config file), and it is keycode value 158.
Looking at the include file keysymdef.h, you see "#define XK_KP_F1 0xFF91"
which is the entry for "keypad function key 1" - also known as PF1.  The
xmodmap client will take either a file entry or a command line remapping, so
you could invoke it as < xmodmap -e "keycode 158 = KP_F1" > (the quotes are
required on the command line) and the deed is done.

If you don't have a copy of the manual, you can get one by using the order
number "015213-A02". Hope that helps.

 -- weber_w@apollo.HP.COM (Walt Weber)


Question:  What else should I know about X keysyms?

Answer:

I suggest you put the following into /usr/X11/lib/XKeysymDB :

LineDel:        1000FF00
CharDel:        1000FF01
Copy:           1000FF02
Cut:            1000FF03
Paste:          1000FF04
Move:           1000FF05
Grow:           1000FF06
Cmd:            1000FF07
Shell:          1000FF08
LeftBar:        1000FF09
RightBar:       1000FF0A
LeftBox:        1000FF0B
RightBox:       1000FF0C
UpBox:          1000FF0D
DownBox:        1000FF0E
Pop:            1000FF0F
Read:           1000FF10
Edit:           1000FF11
Save:           1000FF12
Exit:           1000FF13
Repeat:         1000FF14
KP_parenleft:   1000FFA8
KP_parenright:  1000FFA9

This will let you refer to these keys by name.  For example, the following
resource will define scroll keys for your xterm.  You can put this resource
into your ~/.Xdefaults file and it will get loaded when you start an xterm.

XTerm*VT100.Translations: #override \
    <KeyPress>UpBox       : scroll-back(1,halfpage) \n \
    <KeyPress>DownBox     : scroll-forw(1,halfpage) \n

If you use emacs or motif, you may want to define a "meta" key (motif calls
this an "alt" key, presumably because IBM has some pull at OSF).  You can do
this by creating a ~/.keymod file, an put this in it:

  clear mod1
  keycode 147 = Meta_L
  add mod1 = Meta_L

This makes F0 your meta key.  You can use whatever key you want as your
meta, of course.  Use xev to find out the keycode for the key you want.
Then, when you log in, run this command (I put this in ~/.xsession, which
gets run on my machine when I log in):

  /usr/bin/X11/xmodmap .keymod

 -- Jim Rees

root@siihp1.epfl.ch (04/19/91)

In article <9104171236.AA00634@cml.unl.edu>, gah@CML.UNL.EDU (Glen A. Hansen) writes:
> I am presently running x11r4 @ SR10.3 on a network of Apollo's, using
> twm as a window manager. I have some questions concerning twm and xterm:
> 
-- 

   The problem is that DM keys have no name for the X server, so you have
to name them before twm (or any other X client) can use them. You can use
xmodmap for this. Here is my .xmodmaprc :

! ins mark
keycode 129 = F11
! line del
keycode 130 = F12
! char del
keycode 131 = F13
! copy / cut
keycode 132 = F14
! undo / paste
keycode 133 = F15
! mode / grow
keycode 134 = F16
! debut de ligne
keycode 135 = F17
! shell cmd
keycode 136 = F18
! fin de ligne
keycode 137 = F19
! left arrow box
keycode 138 = F20
! right arrow box
keycode 140 = F21
! next wndw
keycode 142 = F22
! up arrow box
keycode 144 = F23
! down arrow box
keycode 146 = F24

! pop
keycode 157 = F25
! again
keycode 158 = F26
! read
keycode 159 = F27
! save / edit
keycode 160 = F28
! abort / exit
keycode 161 = F29
! help / hold
keycode 162 = F30

  After loading this file, you can have this kind of line in .twmrc :

"F18"         = s  : all         : !"xterm &"      # shell cmd
"F25"         =    : all         : f.raiselower    # pop
"F25"         = s  : all         : f.iconify       # shift pop
"F29"         =    : all         : f.delete        # exit
"F29"         = s  : all         : f.destroy       # abort

  It works for me.



                    Claude Lecommandeur
                    Service Informatique Central
                    Ecole Polytechnique Federale de Lausanne
                    1015 LAUSANNE (SWITZERLAND)
                    E-Mail : lecom@sic.epfl.ch
                    Tel : (41 21) 693-45-86