diff --git a/lispusers/WHEELSCROLL b/lispusers/WHEELSCROLL
index 5cb1b473..baf31632 100644
--- a/lispusers/WHEELSCROLL
+++ b/lispusers/WHEELSCROLL
@@ -1 +1 @@
-(DEFINE-FILE-INFO READTABLE "INTERLISP" PACKAGE "INTERLISP")
(FILECREATED "17-Feb-2021 22:37:01" 
{DSK}<Users>kaplan>Local>medley3.5>git-medley>lispusers>WHEELSCROLL.;31 5760   

      changes to%:  (FNS WHEELSCROLL)

      previous date%: "17-Feb-2021 22:22:29" 
{DSK}<Users>kaplan>Local>medley3.5>git-medley>lispusers>WHEELSCROLL.;28)


(PRETTYCOMPRINT WHEELSCROLLCOMS)

(RPAQQ WHEELSCROLLCOMS
       [(FNS ENABLEWHEELSCROLL WHEELSCROLL INSTALL-WHEELSCROLL LISPINTERRUPTS.WHEELSCROLL)
        [VARS (WHEELSCROLLINTERRUPTS '((520 (WHEELSCROLL 'VERTICAL WHEELSCROLLDELTA)
                                            T)
                                       (521 (WHEELSCROLL 'VERTICAL (IMINUS WHEELSCROLLDELTA))
                                            T]
        (GLOBALVARS WHEELSCROLLDELTA WHEELSCROLLSETTLETIME)
        (INITVARS (WHEELSCROLLDELTA 10)
               (WHEELSCROLLSETTLETIME 50))
        (DECLARE%: DONTEVAL@LOAD DOCOPY (P (INSTALL-WHEELSCROLL)
                                           (ENABLEWHEELSCROLL T])
(DEFINEQ

(ENABLEWHEELSCROLL
  [LAMBDA (ON)                                      (* ; "Edited 15-Feb-2021 18:17 by rmk:")

    (* ;; "So we can toggle this scrolling, for experimentation.")

    (IF ON
        THEN [KEYACTION 'PAD1 '((520 520) . IGNORE]
              [KEYACTION 'PAD2 '((521 521) . IGNORE]
      ELSE (KEYACTION 'PAD1 '(IGNORE . IGNORE))
            (KEYACTION 'PAD2 '(IGNORE . IGNORE])

(WHEELSCROLL
  [LAMBDA (DIRECTION DELTA)                             (* ; "Edited 17-Feb-2021 22:35 by rmk:")

    (* ;; "The wheel may accidentally turn (giving the interrupt) when the users intention is simply to push the middle button.  And there may be another accidental turn (also giving an interrupt) when the user is releasing the middle button.  Here we try to detect and ignore wheel motions in the first case, we don't yet have the information to solve the second.  (This should not be an issue with a trackpad)")

    (* ;; "")

    (* ;; "Below we ignore a motion interrupt if it is received when a mouse button is down. We also ignore if the MIDDLE shows up within an interval of WHEELSCROLLSETTLETIME milliseconds.")

    (CL:WHEN (LET ((W (WHICHW)))

                  (* ;; "Returns the window that should be wheel scrolled, skipping windows that have no SCROLLFN or are pop-up scrollbar window for some other window. ")

                  (* ;; "The behavior of pop-up scrollbars (via IN/SCROLL/BAR? in WINDOWSCROLL) is inconsistent with a direct call to SCROLLW in that SCROLLW uses SCROLLBYREPAINTFN for a window without a SCROLLFN while the pop-up does nothing.  We implement th pop-up behavior, otherwise odd windows like those holding menus would scroll in a funky way.")

                  (CL:WHEN [AND W (WINDOWPROP W 'SCROLLFN)
                                (NOT (WINDOWPROP W (CL:IF (EQ DIRECTION 'VERTICAL)
                                                       'VERTICALSCROLLBARFOR
                                                       'HORIZONTALSCROLLBARFOR)]
                      (CL:WHEN [OR T (AND (MOUSESTATE UP)
                                          (NOT (UNTILMOUSESTATE (ONLY MIDDLE)
                                                      WHEELSCROLLSETTLETIME]

                          (* ;; "Always scroll from the MOUSE process.  Need the KWOTE because PROCESS.EVAL uses CL:EVAL which doesn't like raw windows")

                          [PROCESS.EVAL (FIND.PROCESS 'MOUSE)
                                 (CL:IF (EQ DIRECTION 'VERTICAL)
                                     `(SCROLLW ,(KWOTE W)
                                             0
                                             ,DELTA)
                                     `(SCROLLW ,(KWOTE W)
                                             ,DELTA 0))]))])

(INSTALL-WHEELSCROLL
  [LAMBDA NIL                                           (* ; "Edited 17-Feb-2021 11:53 by rmk:")
    (CL:WHEN (GETD 'LISPINTERRUPTS.WHEELSCROLL)
        (MOVD? 'LISPINTERRUPTS 'LISPINTERRUPTS.WSORIG)
        (MOVD 'LISPINTERRUPTS.WHEELSCROLL 'LISPINTERRUPTS))
    (FOR I IN WHEELSCROLLINTERRUPTS DO (INTERRUPTCHAR (CAR I)
                                                          (CADR I)
                                                          (CADDR I))
                                                  (CL:WHEN (BOUNDP 'TEDIT.READTABLE)

                                                (* ;; "These actions are invoked when the caret is in the Tedit window, because TEDIT disables the interrupts")

                                                      (TEDIT.SETFUNCTION (CAR I)
                                                             `[LAMBDA NIL
                                                                ,(CADR I]
                                                             TEDIT.READTABLE))])

(LISPINTERRUPTS.WHEELSCROLL
  [LAMBDA NIL                                           (* ; "Edited 17-Feb-2021 11:09 by rmk:")

    (* ;; "So wheelscroll interrupts will be installed in every process")

    (APPEND WHEELSCROLLINTERRUPTS (LISPINTERRUPTS.WSORIG])
)

(RPAQQ WHEELSCROLLINTERRUPTS ((520 (WHEELSCROLL 'VERTICAL WHEELSCROLLDELTA)
                                       T)
                                  (521 (WHEELSCROLL 'VERTICAL (IMINUS WHEELSCROLLDELTA))
                                       T)))
(DECLARE%: DOEVAL@COMPILE DONTCOPY

(GLOBALVARS WHEELSCROLLDELTA WHEELSCROLLSETTLETIME)
)

(RPAQ? WHEELSCROLLDELTA 10)

(RPAQ? WHEELSCROLLSETTLETIME 50)
(DECLARE%: DONTEVAL@LOAD DOCOPY 

(INSTALL-WHEELSCROLL)

(ENABLEWHEELSCROLL T)
)
(DECLARE%: DONTCOPY
  (FILEMAP (NIL (1046 5231 (ENABLEWHEELSCROLL 1056 . 1481) (WHEELSCROLL 1483 . 3887) (
INSTALL-WHEELSCROLL 3889 . 4952) (LISPINTERRUPTS.WHEELSCROLL 4954 . 5229)))))
STOP
\ No newline at end of file
+(DEFINE-FILE-INFO READTABLE "INTERLISP" PACKAGE "INTERLISP")
(FILECREATED "21-Feb-2021 09:39:06" 
{DSK}<Users>kaplan>Local>medley3.5>git-medley>lispusers>WHEELSCROLL.;42 6734   

      changes to%:  (VARS WHEELSCROLLCOMS)
                    (FNS WHEELSCROLL)

      previous date%: "20-Feb-2021 17:34:35" 
{DSK}<Users>kaplan>Local>medley3.5>git-medley>lispusers>WHEELSCROLL.;39)


(PRETTYCOMPRINT WHEELSCROLLCOMS)

(RPAQQ WHEELSCROLLCOMS
       [(FNS ENABLEWHEELSCROLL WHEELSCROLL WHEELSCROLL.DOIT INSTALL-WHEELSCROLL 
             LISPINTERRUPTS.WHEELSCROLL)
        [VARS (WHEELSCROLLINTERRUPTS '((520 (WHEELSCROLL 'VERTICAL WHEELSCROLLDELTA)
                                            T)
                                       (521 (WHEELSCROLL 'VERTICAL (IMINUS WHEELSCROLLDELTA))
                                            T]
        (GLOBALVARS WHEELSCROLLDELTA WHEELSCROLLSETTLETIME \WHEELSCROLLINPROGRESS)
        (INITVARS (WHEELSCROLLDELTA 20)
               (WHEELSCROLLSETTLETIME 50)
               (\WHEELSCROLLINPROGRESS NIL))
        (DECLARE%: DONTEVAL@LOAD DOCOPY (P (INSTALL-WHEELSCROLL)
                                           (ENABLEWHEELSCROLL T])
(DEFINEQ

(ENABLEWHEELSCROLL
  [LAMBDA (ON)                                      (* ; "Edited 15-Feb-2021 18:17 by rmk:")

    (* ;; "So we can toggle this scrolling, for experimentation.")

    (IF ON
        THEN [KEYACTION 'PAD1 '((520 520) . IGNORE]
              [KEYACTION 'PAD2 '((521 521) . IGNORE]
      ELSE (KEYACTION 'PAD1 '(IGNORE . IGNORE))
            (KEYACTION 'PAD2 '(IGNORE . IGNORE])

(WHEELSCROLL
  [LAMBDA (DIRECTION DELTA)                             (* ; "Edited 21-Feb-2021 09:38 by rmk:")

    (* ;; "The wheel may accidentally turn (giving the interrupt) when the users intention is simply to push the middle button.  And there may be another accidental turn (also giving an interrupt) when the user is releasing the middle button.  We don't yet have a good solution to this problem.  (This is not an issue with a trackpad)")

    (* ;; "")

    (CL:WHEN (MOUSESTATE UP)                                 (* ; 
                                                           "Ignore interrupt if a button is down")
        [LET ((W (WHICHW)))

         (* Unsuccessful a ttempt to suppress scroll if middlebutton comes down within 
       the setetle time (NOT (UNTILMOUSESTATE (ONLY MIDDLE) WHEELSCROLLSETTLETIME)))

             (CL:WHEN W

                 (* ;; "We scroll only if the window has a scrollfn.  Our behavior is thus different from a direct call to SCROLLW, which defaults to SCROLLBYREPAINTFN in that case, but conforms to what happens with IN/SCROLL/BAR? and SCROLL.HANDLER in WINDOWSCROLL.  Menus and scrollbars typically do not have scrollfns, so this suppresses otherwise funky behavior. ")

                 (IF (WINDOWPROP W 'SCROLLFN)
                     THEN [PROCESS.EVAL (FIND.PROCESS 'MOUSE)
                                     (CL:IF (EQ DIRECTION 'VERTICAL)
                                         `(WHEELSCROLL.DOIT ,(KWOTE W)
                                                 0
                                                 ,DELTA)
                                         `(WHEELSCROLL.DOIT ,(KWOTE W)
                                                 ,DELTA 0))]
                   ELSEIF (EQ DIRECTION 'VERTICAL)
                     THEN 

                           (* ;; "We are in a pop-up scrollbar.  This moves the cursor there, the user has to click to scroll the main window.")

                           (CL:WHEN (WINDOWPROP W 'VERTICALSCROLLBARFOR)
                               (\CURSORPOSITION LASTMOUSEX (IPLUS LASTMOUSEY DELTA))
                               (GETMOUSESTATE))
                   ELSEIF (EQ DIRECTION 'HORIZONTAL)
                     THEN (CL:WHEN (WINDOWPROP W 'HORIZONTALSCROLLBARFOR)
                                  (\CURSORPOSITION (IPLUS DELTA LASTMOUSEX)
                                         LASTMOUSEY)
                                  (GETMOUSESTATE))))])])

(WHEELSCROLL.DOIT
  [LAMBDA (WINDOW DX DY)                                (* ; "Edited 20-Feb-2021 17:34 by rmk:")

    (* ;; "This does the actual wheel scrolling, runing in the mouse process.")

    (* ;; "There have been instances where the window gets garbled as the wheel moves.  The hypothesis is that this is because the wheel moves so fast that another scroll starts before a previous one completes.")

    (* ;; "The global variable \WHEELSCROLLINPROGRESS is set to prevent that interference.")

    (CL:UNLESS \WHEELSCROLLINPROGRESS
        (RESETVAR \WHEELSCROLLINPROGRESS T (SCROLLW WINDOW DX DY)))])

(INSTALL-WHEELSCROLL
  [LAMBDA NIL                                           (* ; "Edited 17-Feb-2021 11:53 by rmk:")
    (CL:WHEN (GETD 'LISPINTERRUPTS.WHEELSCROLL)
        (MOVD? 'LISPINTERRUPTS 'LISPINTERRUPTS.WSORIG)
        (MOVD 'LISPINTERRUPTS.WHEELSCROLL 'LISPINTERRUPTS))
    (FOR I IN WHEELSCROLLINTERRUPTS DO (INTERRUPTCHAR (CAR I)
                                                          (CADR I)
                                                          (CADDR I))
                                                  (CL:WHEN (BOUNDP 'TEDIT.READTABLE)

                                                (* ;; "These actions are invoked when the caret is in the Tedit window, because TEDIT disables the interrupts")

                                                      (TEDIT.SETFUNCTION (CAR I)
                                                             `[LAMBDA NIL
                                                                ,(CADR I]
                                                             TEDIT.READTABLE))])

(LISPINTERRUPTS.WHEELSCROLL
  [LAMBDA NIL                                           (* ; "Edited 17-Feb-2021 11:09 by rmk:")

    (* ;; "So wheelscroll interrupts will be installed in every process")

    (APPEND WHEELSCROLLINTERRUPTS (LISPINTERRUPTS.WSORIG])
)

(RPAQQ WHEELSCROLLINTERRUPTS ((520 (WHEELSCROLL 'VERTICAL WHEELSCROLLDELTA)
                                       T)
                                  (521 (WHEELSCROLL 'VERTICAL (IMINUS WHEELSCROLLDELTA))
                                       T)))
(DECLARE%: DOEVAL@COMPILE DONTCOPY

(GLOBALVARS WHEELSCROLLDELTA WHEELSCROLLSETTLETIME \WHEELSCROLLINPROGRESS)
)

(RPAQ? WHEELSCROLLDELTA 20)

(RPAQ? WHEELSCROLLSETTLETIME 50)

(RPAQ? \WHEELSCROLLINPROGRESS NIL)
(DECLARE%: DONTEVAL@LOAD DOCOPY 

(INSTALL-WHEELSCROLL)

(ENABLEWHEELSCROLL T)
)
(DECLARE%: DONTCOPY
  (FILEMAP (NIL (1187 6142 (ENABLEWHEELSCROLL 1197 . 1622) (WHEELSCROLL 1624 . 4160) (WHEELSCROLL.DOIT 
4162 . 4798) (INSTALL-WHEELSCROLL 4800 . 5863) (LISPINTERRUPTS.WHEELSCROLL 5865 . 6140)))))
STOP
\ No newline at end of file
diff --git a/lispusers/WHEELSCROLL.LCOM b/lispusers/WHEELSCROLL.LCOM
index f3c48249..97812037 100644
Binary files a/lispusers/WHEELSCROLL.LCOM and b/lispusers/WHEELSCROLL.LCOM differ
diff --git a/lispusers/WHEELSCROLL.TXT b/lispusers/WHEELSCROLL.TXT
new file mode 100644
index 00000000..8cab8ba8
Binary files /dev/null and b/lispusers/WHEELSCROLL.TXT differ
