[comp.sys.apollo] How to redefine keys

danny@idacom.uucp (Danny Wilson) (09/16/90)

I am looking for a way to remap all of the letters of the Apollo
keyboard in order to implement the Dvorzak (sp?) keyboard layout.

My original plan was to use the 'kd' DM commands to do this, however,
it seems that will only work for control and function keys etc.

Is there another way of doing this?  In particular, I would like
to change the keyboard layout to end up looking like:

  /   ,   .   P   Y     F   G   C   R   L     Top row

   A   O   E   U   I     D   H   T   N   S    Home row

    ;   Q   J   K   X     B   M   W   V   Z   Bottom row


Any ideas?


-- 
Danny Wilson			danny@idacom.uucp
IDACOM, A division of HP 	alberta!idacom!danny
Edmonton, Alberta	
C A N A D A		Voice	+1 403 462 4545

thompson@PAN.SSEC.HONEYWELL.COM (John Thompson) (09/18/90)

> I am looking for a way to remap all of the letters of the Apollo
> keyboard in order to implement the Dvorzak (sp?) keyboard layout.
Dvorak.

> My original plan was to use the 'kd' DM commands to do this, however,
> it seems that will only work for control and function keys etc.
Sure it does.  You can mess yourself over as thoroughly as you want!

> Is there another way of doing this?  In particular, I would like
> to change the keyboard layout to end up looking like:
> 
>   /   ,   .   P   Y     F   G   C   R   L     Top row
> 
>    A   O   E   U   I     D   H   T   N   S    Home row
> 
>     ;   Q   J   K   X     B   M   W   V   Z   Bottom row
Make a FILE with all the regular keydefs for functions, ctrls, etc.
In addition, put in a line for each 'normal' key in the manner
    kd 'A' es 'A' ke
    kd 'B' es 'B' ke
    ...
    kd 'Z' es 'Z' ke
    kd ' ' es ' ' ke
etc. etc. etc.
Save this file (/tmp/normal), and open up a pad, where you enter
    cmdf /tmp/normal                   but DON'T press RETURN.

Now set up a file (/tmp/dvorak) with all the funky defs you want
    kd 'Q' es '/' ke
    kd 'W' es ',' ke
    kd 'E' es '.' ke
etc. etc. etc.
Save this file as well, open up another pad, and type in
    cmdf /tmp/dvorak                   and press RETURN.

You have now modified your keydefs radically.  Since you made at least
one mistake, you may need to carefully cut and paste to define the
last couple keys like you meant to.  Remember that you need to generate
a "W" to change the "W" key to a comma (and you also need to be able to
generate "'"  ","  "e"  "s"  and  "k"  If you can't find one in your pads
to cut and paste, you can as a last ditch effort press the RETURN key
in the pad that's waiting to define everything normal again (and you thought
that was useless effort!)  You may want to save a copy of your machine-readable
keydefs (kept in user_data) as a final safety measure to help GOD fix
things up again when they're totally ruined.

Good luck!  It's not really hard, just error-prone!

John Thompson (jt)
Honeywell, SSEC
Plymouth, MN  55441
thompson@pan.ssec.honeywell.com

As ever, my opinions do not necessarily agree with Honeywell's or reality's.
(Honeywell's do not necessarily agree with mine or reality's, either)

klaus@diku.dk (Klaus Ole Kristiansen) (09/18/90)

kd works ok here. Did you remember to put quotes around the
key name?

Klaus Kristiansen

goldfish@CONCOUR.CS.CONCORDIA.CA (-- Paul Goldsmith) (09/18/90)

Once you are redefining your keys, you should probably define one of
the function keys to execute the DM scripts to convbert back.

ie:	kd F8  xdmc user_data/dvorak  ; msg 'dvorak keyboard enabled'  ke
	kd F8S xdmc user_data/qwerty  ; msg 'qwerty keyboard enabled'   ke

The syntax is probably incorrect, but the idea is that you can get
back to a known state.

Also look for a file named "key_dump" it can be useful in building
entries for this sort of thing.  My copy is greatly hacked from the
original, and I can't remember where I found it, (you might try a
posting to Comp.Sys.Apollo for the original author, I have hacked mine
to include the Keyboard-3 features and will post it if the original
author gives me clearance to do so.)

Once we are discussing changing the key map, I have made the following
changes:

	#	define F9 to toggle large/normal/small type
	kd F9  fl /sys/dm/fonts/courier-boldoblique18  ; msg 'courier-boldoblique18'  ke
	kd F9S fl /sys/dm/fonts/f5x9.b                 ; msg 'f5x9.b'                 ke
	kd F9C fl /sys/dm/fonts/old_english.36         ; msg 'old_english.36'         ke
	kd F9U fl /sys/dm/fonts/std.color              ; msg 'std.color'              ke

These allow me to access four different fonts by the four states of
the F9 key and always return to the default one.  I find this very
useful.

	#	change mouse defn to do marking
	kd M2  dr ; echo    ; msg 'mark text'      ke
	kd M2U xc           ; msg 'Copy to buffer' ke
	kd M2S dr ; echo -r ; msg 'mark rectangle' ke

These make the middle mouse button act like a Macintosh cut and paste
button.  I never use the functions of the middle button anyway, and
this is a good example of using the "upstroke" event for something
useful.

The "Domain/OS Display Manager Command Reference (011418-A00)" is
surprisingly useful for an Apollo manual and is a good reference.

-- Paul Goldsmith
    (goldfish)        (514) 848-3031         <goldfish@concour.cs.concordia.ca>
         (Shirley Maclaine told me there would be LIFETIMES like this)

lambert@spectrum.cs.unsw.oz.au (Tim Lambert) (09/19/90)

On the subject of key definitions:

One I find incredibly useful is the following:

#copy name pointed to to input pad from transcript pad
kd m2 /[~a-zA-Z!-._:$0-9@@/@@\@@-@@(@@)~`%^*_+=!]/dr;
      \\;/?/xc file_name;
       ti;tb;tr ke
kd m2u xp file_name;tr;es ' ';gm ke

Typical use: suppose I want to remove a bunch of files.  I say 'ls' to
get a listing, then type 'rm ' and grab the mouse and click on the all
the names of files that I want deleted.  Pressing NEXT WNDW and RETURN
completes the process.

If you hold M2 down instead of clicking you can copy the file name
whereever you want.

Tim

stluka@software.org (Fred Stluka) (09/20/90)

How long has it been possible to redefine the normal (alphabetic)
keys on the Apollo keyboard?  Has it always been that way?  

When I first started using Apollo's in 1987, I read through all 
the DM manuals, and redefined keys like crazy. I set up some 
key-chording, modified the numeric keypad to look a lot like 
the VMS EDT keypad which my fingers knew so well, etc.
I programmed the function keys, the control keys, up-strokes,
down-strokes, shifted and unshifted, but I never tripped across 
the fact that the keynames for the regular alphabetic keys are 
the characters in quotes.  This means I can define as many 
shift (meta) keys as I want by defining the down-stroke of 
each meta key to remap the entire keyboard, and defining the 
up-stroke to put it back.  I love it!

How long has this been possible?  And where is it documented?

--Fred

Fred Stluka                          Internet: stluka@software.org
Software Productivity Consortium     UUNET:    ...!uunet!software!stluka
2214 Rock Hill Rd, Herndon VA 22070