(FILECREATED "15-Feb-85 18:07:21" {ERIS}<LISPUSERS>HARMONYKEYPATCH.;9 19186  

      changes to:  (RECORDS SHIFTSTATE)
		   (FNS \KEYACTION1 MIDDLEMOUSEKEY NEWGETMOUSESTATE GETMOUSESTATE SHIFTDOWNP 
			NEW\DECODETRANSITION)
		   (VARS HARMONYKEYPATCHCOMS TRANSITIONFLAGS FONTDOWN.TF FONTUP.TF FONTTOGGLE.TF 
			 \KEYNAMES)

      previous date: " 4-Feb-85 16:03:17" {ERIS}<LISPUSERS>HARMONYKEYPATCH.;5)


(* Copyright (c) 1985 by Xerox Corporation. All rights reserved.)

(PRETTYCOMPRINT HARMONYKEYPATCHCOMS)

(RPAQQ HARMONYKEYPATCHCOMS ((FNS SHIFTDOWNP \KEYACTION1 NEW\DECODETRANSITION NEWGETMOUSESTATE 
				 MIDDLEMOUSEKEY)
			    (P (MIDDLEMOUSEKEY (QUOTE CENTER))
			       (MOVD (QUOTE NEWGETMOUSESTATE)
				     (QUOTE GETMOUSESTATE)))
			    (GLOBALVARS \MIDDLEMOUSEKEYNAME \MIDDLEMOUSEKEYNUMBER)
			    (VARS \KEYNAMES)
			    [DECLARE: DONTEVAL@LOAD DOCOPY
				      (P (AND (CCODEP (QUOTE NEW\DECODETRANSITION))
					      (WITHOUT-INTERRUPTS (PROGN (MOVD (QUOTE 
									     NEW\DECODETRANSITION)
									       (QUOTE 
										\DECODETRANSITION))
									 (\LOCKFN (QUOTE 
										\DECODETRANSITION]
			    (DECLARE: DONTCOPY (RECORDS SHIFTSTATE)
				      (CONSTANTS * TRANSITIONFLAGS))))
(DEFINEQ

(SHIFTDOWNP
  [LAMBDA (SHIFT)                                            (* rmk: " 4-Feb-85 14:50")
                                                             (* Tells whether a given shift is down)
    (SELECTQ SHIFT
	     (LOCK (ffetch (SHIFTSTATE LOCK) of \SHIFTSTATE))
	     (META (ffetch (SHIFTSTATE META) of \SHIFTSTATE))
	     (SHIFT (ffetch (SHIFTSTATE SHIFT) of \SHIFTSTATE))
	     (1SHIFT (ffetch (SHIFTSTATE 1SHIFT) of \SHIFTSTATE))
	     (2SHIFT (ffetch (SHIFTSTATE 2SHIFT) of \SHIFTSTATE))
	     (SHIFTORLOCK (ffetch (SHIFTSTATE SHIFTORLOCK) of \SHIFTSTATE))
	     (CTRL (ffetch (SHIFTSTATE CTRL) of \SHIFTSTATE))
	     (FONT (ffetch (SHIFTSTATE FONT) of \SHIFTSTATE))
	     (USERMODE1 (ffetch (SHIFTSTATE USERMODE1) of \SHIFTSTATE))
	     (USERMODE2 (ffetch (SHIFTSTATE USERMODE2) of \SHIFTSTATE))
	     (USERMODE3 (ffetch (SHIFTSTATE USERMODE3) of \SHIFTSTATE))
	     (\ILLEGAL.ARG SHIFT])

(\KEYACTION1
  [LAMBDA (TI ACTION)                                        (* rmk: "15-Feb-85 18:04")
    (PROG1 (SELECTC (fetch (TRANSITION FLAGS) of TI)
		    (IGNORE.TF (QUOTE IGNORE))
		    [(LIST LOCKSHIFT.TF NOLOCKSHIFT.TF)
		      (LIST (fetch (TRANSITION CODE) of TI)
			    (fetch (TRANSITION SHIFTCODE) of TI)
			    (COND
			      ((EQ LOCKSHIFT.TF (fetch (TRANSITION FLAGS) of TI))
				(QUOTE LOCKSHIFT))
			      (T (QUOTE NOLOCKSHIFT]
		    (EVENT.TF (QUOTE EVENT))
		    (CTRLDOWN.TF (QUOTE CTRLDOWN))
		    (CTRLUP.TF (QUOTE CTRLUP))
		    (1SHIFTDOWN.TF (QUOTE 1SHIFTDOWN))
		    (1SHIFTUP.TF (QUOTE 1SHIFTUP))
		    (2SHIFTDOWN.TF (QUOTE 2SHIFTDOWN))
		    (2SHIFTUP.TF (QUOTE 2SHIFTUP))
		    (LOCKDOWN.TF (QUOTE LOCKDOWN))
		    (LOCKUP.TF (QUOTE LOCKUP))
		    (LOCKTOGGLE.TF (QUOTE LOCKTOGGLE))
		    (METADOWN.TF (QUOTE METADOWN))
		    (METAUP.TF (QUOTE METAUP))
		    (FONTUP.TF (QUOTE FONTUP))
		    (FONTDOWN.TF (QUOTE FONTDOWN))
		    (FONTTOGGLE.TF (QUOTE FONTTOGGLE))
		    (USERMODE1UP.TF (QUOTE USERMODE1UP))
		    (USERMODE1DOWN.TF (QUOTE USERMODE1DOWN))
		    (USERMODE1TOGGLE.TF (QUOTE USERMODE1TOGGLE))
		    (USERMODE2UP.TF (QUOTE USERMODE2UP))
		    (USERMODE2DOWN.TF (QUOTE USERMODE2DOWN))
		    (USERMODE2TOGGLE.TF (QUOTE USERMODE2TOGGLE))
		    (USERMODE3UP.TF (QUOTE USERMODE3UP))
		    (USERMODE3DOWN.TF (QUOTE USERMODE3DOWN))
		    (USERMODE3TOGGLE.TF (QUOTE USERMODE3TOGGLE))
		    (SHOULDNT))
	   (SELECTQ ACTION
		    ((NIL NOCHANGE))
		    (IGNORE (replace (TRANSITION FLAGS) of TI with IGNORE.TF))
		    (EVENT (replace (TRANSITION FLAGS) of TI with EVENT.TF))
		    (CTRLUP (replace (TRANSITION FLAGS) of TI with CTRLUP.TF))
		    (CTRLDOWN (replace (TRANSITION FLAGS) of TI with CTRLDOWN.TF))
		    (1SHIFTUP (replace (TRANSITION FLAGS) of TI with 1SHIFTUP.TF))
		    (1SHIFTDOWN (replace (TRANSITION FLAGS) of TI with 1SHIFTDOWN.TF))
		    (2SHIFTUP (replace (TRANSITION FLAGS) of TI with 2SHIFTUP.TF))
		    (2SHIFTDOWN (replace (TRANSITION FLAGS) of TI with 2SHIFTDOWN.TF))
		    (LOCKUP (replace (TRANSITION FLAGS) of TI with LOCKUP.TF))
		    (LOCKDOWN (replace (TRANSITION FLAGS) of TI with LOCKDOWN.TF))
		    (LOCKTOGGLE (replace (TRANSITION FLAGS) of TI with LOCKTOGGLE.TF))
		    (METAUP (replace (TRANSITION FLAGS) of TI with METAUP.TF))
		    (METADOWN (replace (TRANSITION FLAGS) of TI with METADOWN.TF))
		    (FONTUP (replace (TRANSITION FLAGS) of TI with FONTUP.TF))
		    (FONTDOWN (replace (TRANSITION FLAGS) of TI with FONTDOWN.TF))
		    (FONTTOGGLE (replace (TRANSITION FLAGS) of TI with FONTTOGGLE.TF))
		    (USERMODE1UP (replace (TRANSITION FLAGS) of TI with USERMODE1UP.TF))
		    (USERMODE1DOWN (replace (TRANSITION FLAGS) of TI with USERMODE1DOWN.TF))
		    (USERMODE1TOGGLE (replace (TRANSITION FLAGS) of TI with USERMODE1TOGGLE.TF))
		    (USERMODE2UP (replace (TRANSITION FLAGS) of TI with USERMODE2UP.TF))
		    (USERMODE2DOWN (replace (TRANSITION FLAGS) of TI with USERMODE2DOWN.TF))
		    (USERMODE2TOGGLE (replace (TRANSITION FLAGS) of TI with USERMODE2TOGGLE.TF))
		    (USERMODE3UP (replace (TRANSITION FLAGS) of TI with USERMODE3UP.TF))
		    (USERMODE3DOWN (replace (TRANSITION FLAGS) of TI with USERMODE3DOWN.TF))
		    (USERMODE3TOGGLE (replace (TRANSITION FLAGS) of TI with USERMODE3TOGGLE.TF))
		    (PROG (CODE SHIFTCODE ACT)
		          (COND
			    ((AND [\CHARCODEP (SETQ CODE (\GETCHARCODE (CAR (LISTP ACTION]
				  [\CHARCODEP (SETQ SHIFTCODE (\GETCHARCODE
						  (CAR (SETQ ACT (LISTP (CDR ACTION]
				  (OR (NULL (SETQ ACT (CDR ACT)))
				      (LISTP ACT))
				  (SELECTQ (CAR ACT)
					   ((LOCKSHIFT T)
					     (replace (TRANSITION FLAGS) of TI with LOCKSHIFT.TF))
					   ((NOLOCKSHIFT NIL)
					     (replace (TRANSITION FLAGS) of TI with NOLOCKSHIFT.TF))
					   NIL))
			      (replace (TRANSITION CODE) of TI with CODE)
			      (replace (TRANSITION SHIFTCODE) of TI with SHIFTCODE))
			    (T (\ILLEGAL.ARG ACTION])

(NEW\DECODETRANSITION
  [LAMBDA (KEYNUMBER DOWNFLG)                                (* rmk: " 4-Feb-85 14:52")

          (* KEYNUMBER is the key number in the hardware keyboard layout, DOWNFLG is T if the key just went down.
	  PENDINGINTERRUPT, bound in \KEYHANDLER, is set to the decoded character if it is an interrupt.)


    (DECLARE (USEDFREE PENDINGINTERRUPT))
    (.NOTELASTUSERACTION)
    (PROG (ASCIICODE (TI (\TRANSINDEX KEYNUMBER DOWNFLG)))
          (SELECTC (fetch (TRANSITION FLAGS) of TI)
		   (IGNORE.TF (RETURN))
		   [LOCKSHIFT.TF (SETQ ASCIICODE (COND
				     ((fetch (SHIFTSTATE SHIFTORLOCK) of \SHIFTSTATE)
				       (fetch (TRANSITION SHIFTCODE) of TI))
				     (T (fetch (TRANSITION CODE) of TI]
		   [NOLOCKSHIFT.TF (SETQ ASCIICODE (COND
				       ((fetch (SHIFTSTATE SHIFT) of \SHIFTSTATE)
					 (fetch (TRANSITION SHIFTCODE) of TI))
				       (T (fetch (TRANSITION CODE) of TI]
		   (EVENT.TF (SELECTC (fetch EVENTSENABLED of \EVENTSTATUS)
				      (NO.EV)
				      (CHAR.EV (\PUTEVENTQUEUE (fetch EVENTCHARCODE of \EVENTSTATUS)))
				      (YES.EV (\PUTEVENTQUEUE))
				      (SHOULDNT))
			     (RETURN))
		   (1SHIFTUP.TF (replace (SHIFTSTATE 1SHIFT) of \SHIFTSTATE with NIL)
				(RETURN))
		   (1SHIFTDOWN.TF (replace (SHIFTSTATE 1SHIFT) of \SHIFTSTATE with T)
				  (RETURN))
		   (2SHIFTUP.TF (replace (SHIFTSTATE 2SHIFT) of \SHIFTSTATE with NIL)
				(RETURN))
		   (2SHIFTDOWN.TF (replace (SHIFTSTATE 2SHIFT) of \SHIFTSTATE with T)
				  (RETURN))
		   (LOCKUP.TF (replace (SHIFTSTATE LOCK) of \SHIFTSTATE with NIL)
			      (RETURN))
		   (LOCKDOWN.TF (replace (SHIFTSTATE LOCK) of \SHIFTSTATE with T)
				(RETURN))
		   (LOCKTOGGLE.TF (replace (SHIFTSTATE LOCK) of \SHIFTSTATE
				     with (NOT (fetch (SHIFTSTATE LOCK) of \SHIFTSTATE)))
				  (RETURN))
		   (CTRLUP.TF (replace (SHIFTSTATE CTRL) of \SHIFTSTATE with NIL)
			      (RETURN))
		   (CTRLDOWN.TF (replace (SHIFTSTATE CTRL) of \SHIFTSTATE with T)
				(RETURN))
		   (METAUP.TF (replace (SHIFTSTATE META) of \SHIFTSTATE with NIL)
			      (RETURN))
		   (METADOWN.TF (replace (SHIFTSTATE META) of \SHIFTSTATE with T)
				(RETURN))
		   (FONTUP.TF (replace (SHIFTSTATE FONT) of \SHIFTSTATE with NIL)
			      (RETURN))
		   (FONTDOWN.TF (replace (SHIFTSTATE FONT) of \SHIFTSTATE with T)
				(RETURN))
		   (FONTTOGGLE.TF (replace (SHIFTSTATE FONT) of \SHIFTSTATE
				     with (NOT (fetch (SHIFTSTATE FONT) of \SHIFTSTATE)))
				  (RETURN))
		   (USERMODE1UP.TF (replace (SHIFTSTATE USERMODE1) of \SHIFTSTATE with NIL)
				   (RETURN))
		   (USERMODE1DOWN.TF (replace (SHIFTSTATE USERMODE1) of \SHIFTSTATE with T)
				     (RETURN))
		   (USERMODE1TOGGLE.TF (replace (SHIFTSTATE USERMODE1) of \SHIFTSTATE
					  with (NOT (fetch (SHIFTSTATE USERMODE1) of \SHIFTSTATE)))
				       (RETURN))
		   (USERMODE2UP.TF (replace (SHIFTSTATE USERMODE2) of \SHIFTSTATE with NIL)
				   (RETURN))
		   (USERMODE2DOWN.TF (replace (SHIFTSTATE USERMODE2) of \SHIFTSTATE with T)
				     (RETURN))
		   (USERMODE2TOGGLE.TF (replace (SHIFTSTATE USERMODE2) of \SHIFTSTATE
					  with (NOT (fetch (SHIFTSTATE USERMODE2) of \SHIFTSTATE)))
				       (RETURN))
		   (USERMODE3UP.TF (replace (SHIFTSTATE USERMODE3) of \SHIFTSTATE with NIL)
				   (RETURN))
		   (USERMODE3DOWN.TF (replace (SHIFTSTATE USERMODE3) of \SHIFTSTATE with T)
				     (RETURN))
		   (USERMODE3TOGGLE.TF (replace (SHIFTSTATE USERMODE3) of \SHIFTSTATE
					  with (NOT (fetch (SHIFTSTATE USERMODE3) of \SHIFTSTATE)))
				       (RETURN))
		   (SHOULDNT))
          (AND (fetch (SHIFTSTATE CTRL) of \SHIFTSTATE)
	       (SETQ ASCIICODE (LOGAND ASCIICODE \CTRLMASK)))
          (AND (OR (fetch (SHIFTSTATE META) of \SHIFTSTATE)
		   (fetch (SHIFTSTATE FONT) of \SHIFTSTATE))
	       (SETQ ASCIICODE (LOGOR ASCIICODE \METABIT)))
          (COND
	    ((fetch ARMED of ASCIICODE)
	      (SETQ \PENDINGINTERRUPT T)
	      (replace WAITINGINTERRUPT of \INTERRUPTSTATE with T)
	      (replace INTCHARCODE of \INTERRUPTSTATE with ASCIICODE))
	    (T (\PUTSYSBUF ASCIICODE])

(NEWGETMOUSESTATE
  [LAMBDA NIL                                                (* rmk: " 4-Feb-85 15:44")
                                                             (* Reads the current state of the mouse and keyboard)
    (SETQ LASTMOUSEX (\XMOUSECOORD))
    (SETQ LASTMOUSEY (\YMOUSECOORD))
    (SETQ LASTMOUSEBUTTONS (LOGOR (COND
				    ((AND \MIDDLEMOUSEKEYNUMBER (KEYDOWNP1 \MIDDLEMOUSEKEYNUMBER))
				      \MOUSE.MIDDLEBIT)
				    (T 0))
				  (LOGXOR (LOGAND (\GETBASE \EM.UTILIN 0)
						  \MOUSE.ALLBITS)
					  \MOUSE.ALLBITS)))
    (SETQ LASTMOUSETIME (fetch (FIXP LONUM) of (\CLOCK0 \MOUSETIMEBOX)))
    (SETQ LASTKEYBOARD (\EVENTKEYS))
    NIL])

(MIDDLEMOUSEKEY
  [LAMBDA (KEYNAME)                                          (* rmk: " 4-Feb-85 16:49")
    (DECLARE (GLOBALVARS \MIDDLEMOUSEKEYNAME \MIDDLEMOUSEKEYNUMBER))
    (PROG1 \MIDDLEMOUSEKEYNAME (AND KEYNAME (COND
				      ((EQ KEYNAME (QUOTE NONE))
					(SETQ \MIDDLEMOUSEKEYNAME (QUOTE NONE))
					(SETQ \MIDDLEMOUSEKEYNUMBER NIL))
				      (T (SETQ \MIDDLEMOUSEKEYNUMBER (\KEYNAMETONUMBER KEYNAME))
					 (SETQ \MIDDLEMOUSEKEYNAME KEYNAME])
)
(MIDDLEMOUSEKEY (QUOTE CENTER))
(MOVD (QUOTE NEWGETMOUSESTATE)
      (QUOTE GETMOUSESTATE))
(DECLARE: DOEVAL@COMPILE DONTCOPY

(GLOBALVARS \MIDDLEMOUSEKEYNAME \MIDDLEMOUSEKEYNUMBER)
)

(RPAQQ \KEYNAMES ((5 %%)
		  (4 $)
		  (6 ~)
		  (e E)
		  (7 &)
		  (d D)
		  (u U)
		  (v V)
		  (0 %))
		  (k K)
		  (- %)
		  (p P)
		  (/ ?)
		  (\ %| FONT)
		  (LF SAME)
		  (BS <-)
		  (3 #)
		  (2 @)
		  (w W)
		  (q Q)
		  (s S)
		  (a A)
		  (9 %()
		  (i I)
		  (x X)
		  (o O)
		  (l L)
		  (, <)
		  (' %")
		  (%] })
		  (BLANK-MIDDLE OPEN)
		  (BLANK-TOP KEYBOARD)
		  (1 !)
		  (ESC ESCAPE ->)
		  (TAB =>)
		  (f F)
		  (CTRL PROP'S)
		  (c C)
		  (j J)
		  (b B)
		  (z Z)
		  (LSHIFT)
		  (%. >)
		  (; :)
		  (CR <-%|)
		  (← ↑)
		  (DEL DELETE)
		  (SKIP NEXT)
		  (r R)
		  (t T)
		  (g G)
		  (y Y)
		  (h H)
		  (8 *)
		  (n N)
		  (m M)
		  (LOCK)
		  (SPACE)
		  (%[ {)
		  (= +)
		  (RSHIFT)
		  (BLANK-BOTTOM STOP)
		  (MOVE)
		  (UNDO)
		  (UTIL0)
		  (UTIL1)
		  (UTIL2)
		  (UTIL3)
		  (UTIL4)
		  (UTIL5)
		  (UTIL6)
		  (UTIL7)
		  (PAD1 LEFTKEY)
		  (PAD2 LEFTMIDDLEKEY)
		  (PAD3 MIDDLEKEY)
		  (PAD4 RIGHTMIDDLEKEY)
		  (PAD5 RIGHTKEY)
		  (LEFT RED MOUSERED)
		  (RIGHT BLUE MOUSEBLUE)
		  (MIDDLE YELLOW MOUSEYELLOW)
		  (MARGINS)
		  (K41)
		  (K42)
		  (K43)
		  (K44)
		  (K45)
		  (K46)
		  (K47)
		  (K48)
		  (COPY)
		  (FIND)
		  (AGAIN)
		  (HELP)
		  (DEF'N EXPAND)
		  (K4E)
		  (ALWAYS-ON-1)
		  (ALWAYS-ON-2)
		  (CENTER)
		  (K52)
		  (BOLD)
		  (ITALICS)
		  (UNDERLINE)
		  (SUPERSCRIPT)
		  (SUBSCRIPT)
		  (LARGER SMALLER)
		  (K59)
		  (K5A)
		  (K5B)
		  (K5C)
		  (DEFAULTS)
		  (K5E)
		  (K5F)))
(DECLARE: DONTEVAL@LOAD DOCOPY 
[AND (CCODEP (QUOTE NEW\DECODETRANSITION))
     (WITHOUT-INTERRUPTS (PROGN (MOVD (QUOTE NEW\DECODETRANSITION)
				      (QUOTE \DECODETRANSITION))
				(\LOCKFN (QUOTE \DECODETRANSITION]
)
(DECLARE: DONTCOPY 
[DECLARE: EVAL@COMPILE 

(ACCESSFNS SHIFTSTATE [[SHIFT (NOT (EQ 0 (LOGAND (\GETBASEBYTE DATUM 0)
						 (LOGOR 1SHIFTBIT 2SHIFTBIT]
		       [1SHIFT [NOT (EQ 0 (LOGAND 1SHIFTBIT (\GETBASEBYTE DATUM 0]
			       (\PUTBASEBYTE DATUM 0 (COND
					       (NEWVALUE (LOGOR 1SHIFTBIT (\GETBASEBYTE DATUM 0)))
					       (T (LOGAND (\GETBASEBYTE DATUM 0)
							  (LOGXOR \CHARMASK 1SHIFTBIT]
		       [2SHIFT [NOT (EQ 0 (LOGAND 2SHIFTBIT (\GETBASEBYTE DATUM 0]
			       (\PUTBASEBYTE DATUM 0 (COND
					       (NEWVALUE (LOGOR 2SHIFTBIT (\GETBASEBYTE DATUM 0)))
					       (T (LOGAND (\GETBASEBYTE DATUM 0)
							  (LOGXOR \CHARMASK 2SHIFTBIT]
		       [LOCK [NOT (EQ 0 (LOGAND LOCKBIT (\GETBASEBYTE DATUM 0]
			     (\PUTBASEBYTE DATUM 0 (COND
					     (NEWVALUE (LOGOR LOCKBIT (\GETBASEBYTE DATUM 0)))
					     (T (LOGAND (\GETBASEBYTE DATUM 0)
							(LOGXOR \CHARMASK LOCKBIT]
		       [SHIFTORLOCK (NOT (EQ 0 (\GETBASEBYTE DATUM 0)))
				    (\PUTBASEBYTE DATUM 0 (COND
						    (NEWVALUE (HELP " Can't turn on SHIFTORLOCK"))
						    (T 0]
		       [CTRL (NOT (EQ 0 (\GETBASEBYTE DATUM 1)))
			     (\PUTBASEBYTE DATUM 1 (COND
					     (NEWVALUE 1)
					     (T 0]
		       [META (NOT (EQ 0 (\GETBASEBYTE DATUM 2)))
			     (\PUTBASEBYTE DATUM 2 (COND
					     (NEWVALUE 1)
					     (T 0]
		       [FONT (NEQ 0 (LOGAND (LLSH 1 3)
					    (\GETBASEBYTE DATUM 3)))
			     (\PUTBASEBYTE DATUM 3 (COND
					     (NEWVALUE (LOGOR (LLSH 1 3)
							      (\GETBASEBYTE DATUM 3)))
					     (T (LOGAND (\GETBASEBYTE DATUM 3)
							(LOGXOR \CHARMASK (LLSH 1 3]
		       [USERMODE1 (NEQ 0 (LOGAND (LLSH 1 0)
						 (\GETBASEBYTE DATUM 3)))
				  (\PUTBASEBYTE DATUM 3 (COND
						  (NEWVALUE (LOGOR (LLSH 1 0)
								   (\GETBASEBYTE DATUM 3)))
						  (T (LOGAND (\GETBASEBYTE DATUM 3)
							     (LOGXOR \CHARMASK (LLSH 1 0]
		       [USERMODE2 (NEQ 0 (LOGAND (LLSH 1 1)
						 (\GETBASEBYTE DATUM 3)))
				  (\PUTBASEBYTE DATUM 3 (COND
						  (NEWVALUE (LOGOR (LLSH 1 1)
								   (\GETBASEBYTE DATUM 3)))
						  (T (LOGAND (\GETBASEBYTE DATUM 3)
							     (LOGXOR \CHARMASK (LLSH 1 1]
		       (USERMODE3 (NEQ 0 (LOGAND (LLSH 1 2)
						 (\GETBASEBYTE DATUM 3)))
				  (\PUTBASEBYTE DATUM 3 (COND
						  (NEWVALUE (LOGOR (LLSH 1 2)
								   (\GETBASEBYTE DATUM 3)))
						  (T (LOGAND (\GETBASEBYTE DATUM 3)
							     (LOGXOR \CHARMASK (LLSH 1 2])
]


(RPAQQ TRANSITIONFLAGS (CTRLDOWN.TF CTRLUP.TF IGNORE.TF EVENT.TF LOCKDOWN.TF LOCKSHIFT.TF 
				    LOCKTOGGLE.TF LOCKUP.TF NOLOCKSHIFT.TF 1SHIFTDOWN.TF 1SHIFTUP.TF 
				    2SHIFTDOWN.TF 2SHIFTUP.TF METADOWN.TF METAUP.TF FONTDOWN.TF 
				    FONTUP.TF FONTTOGGLE.TF USERMODE1UP.TF USERMODE1DOWN.TF 
				    USERMODE1TOGGLE.TF USERMODE2UP.TF USERMODE2DOWN.TF 
				    USERMODE2TOGGLE.TF USERMODE3UP.TF USERMODE3DOWN.TF 
				    USERMODE3TOGGLE.TF))
(DECLARE: EVAL@COMPILE 

(RPAQQ CTRLDOWN.TF 5)

(RPAQQ CTRLUP.TF 4)

(RPAQQ IGNORE.TF 0)

(RPAQQ EVENT.TF 1)

(RPAQQ LOCKDOWN.TF 8)

(RPAQQ LOCKSHIFT.TF 2)

(RPAQQ LOCKTOGGLE.TF 14)

(RPAQQ LOCKUP.TF 7)

(RPAQQ NOLOCKSHIFT.TF 3)

(RPAQQ 1SHIFTDOWN.TF 6)

(RPAQQ 1SHIFTUP.TF 9)

(RPAQQ 2SHIFTDOWN.TF 11)

(RPAQQ 2SHIFTUP.TF 10)

(RPAQQ METADOWN.TF 13)

(RPAQQ METAUP.TF 12)

(RPAQQ FONTDOWN.TF 24)

(RPAQQ FONTUP.TF 25)

(RPAQQ FONTTOGGLE.TF 26)

(RPAQQ USERMODE1UP.TF 15)

(RPAQQ USERMODE1DOWN.TF 16)

(RPAQQ USERMODE1TOGGLE.TF 17)

(RPAQQ USERMODE2UP.TF 18)

(RPAQQ USERMODE2DOWN.TF 19)

(RPAQQ USERMODE2TOGGLE.TF 20)

(RPAQQ USERMODE3UP.TF 21)

(RPAQQ USERMODE3DOWN.TF 22)

(RPAQQ USERMODE3TOGGLE.TF 23)

(CONSTANTS CTRLDOWN.TF CTRLUP.TF IGNORE.TF EVENT.TF LOCKDOWN.TF LOCKSHIFT.TF LOCKTOGGLE.TF LOCKUP.TF 
	   NOLOCKSHIFT.TF 1SHIFTDOWN.TF 1SHIFTUP.TF 2SHIFTDOWN.TF 2SHIFTUP.TF METADOWN.TF METAUP.TF 
	   FONTDOWN.TF FONTUP.TF FONTTOGGLE.TF USERMODE1UP.TF USERMODE1DOWN.TF USERMODE1TOGGLE.TF 
	   USERMODE2UP.TF USERMODE2DOWN.TF USERMODE2TOGGLE.TF USERMODE3UP.TF USERMODE3DOWN.TF 
	   USERMODE3TOGGLE.TF)
)
)
(PUTPROPS HARMONYKEYPATCH COPYRIGHT ("Xerox Corporation" 1985))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (1220 12743 (SHIFTDOWNP 1230 . 2244) (\KEYACTION1 2246 . 6785) (NEW\DECODETRANSITION 
6787 . 11480) (NEWGETMOUSESTATE 11482 . 12225) (MIDDLEMOUSEKEY 12227 . 12741)))))
STOP