diff --git a/lispusers/WHEELSCROLL b/lispusers/WHEELSCROLL
index e71d6c40..5cb1b473 100644
--- a/lispusers/WHEELSCROLL
+++ b/lispusers/WHEELSCROLL
@@ -1 +1 @@
-(DEFINE-FILE-INFO READTABLE "INTERLISP" PACKAGE "INTERLISP")
(FILECREATED "16-Feb-2021 22:36:05" 
{DSK}<Users>kaplan>Local>medley3.5>git-medley>lispusers>WHEELSCROLL.;11 5620   

      changes to%:  (FNS \TEDIT.WHEELSCROLL \SCROLLBARTOMAIN?)

      previous date%: "16-Feb-2021 16:10:43" 
{DSK}<Users>kaplan>Local>medley3.5>git-medley>lispusers>WHEELSCROLL.;8)


(PRETTYCOMPRINT WHEELSCROLLCOMS)

(RPAQQ WHEELSCROLLCOMS [(FNS ENABLEWHEELSCROLL WHEELSCROLL INSTALL-WHEELSCROLL 
                                 LISPINTERRUPTS.WHEELSCROLL CREATESCROLLBARWINDOW \SCROLLBARTOMAIN?)
                            (FNS \TEDIT.WHEELSCROLL)
                            (INITVARS (WHEELSCROLLDELTA 10))
                            (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 (UP)                                          (* ; "Edited 16-Feb-2021 15:35 by rmk:")
    (LET ((W (\SCROLLBARTOMAIN?)))
         (CL:WHEN W
             (SCROLLW W 0 (CL:IF UP
                              (IMINUS WHEELSCROLLDELTA)
                              WHEELSCROLLDELTA)))])

(INSTALL-WHEELSCROLL
  [LAMBDA NIL                                           (* ; "Edited 16-Feb-2021 14:38 by rmk:")
    (CL:WHEN (GETD 'LISPINTERRUPTS.WHEELSCROLL)
        (MOVD? 'LISPINTERRUPTS 'LISPINTERRUPTS.WSORIG)
        (MOVD 'LISPINTERRUPTS.WHEELSCROLL 'LISPINTERRUPTS))
    (INTERRUPTCHAR 520 '(WHEELSCROLL T)
           T)
    (INTERRUPTCHAR 521 '(WHEELSCROLL NIL)
           T)
    (CHANGENAME 'SCROLL.HANDLER 'CREATEW 'CREATESCROLLBARWINDOW)
    (CL:WHEN (BOUNDP 'TEDIT.READTABLE)

        (* ;; "These actions are invoked when the caret is in the Tedit window.  Otherwise the generic function is called on the Tedit window if the cursor is inside it.")

        (TEDIT.SETFUNCTION 520 [FUNCTION (LAMBDA NIL
                                           (\TEDIT.WHEELSCROLL T]
               TEDIT.READTABLE)
        (TEDIT.SETFUNCTION 521 [FUNCTION (LAMBDA NIL
                                           (\TEDIT.WHEELSCROLL NIL]
               TEDIT.READTABLE))
    (CL:WHEN (GETP 'SEDIT 'FILEDATES)
        (SEDIT:ADD-COMMAND 520 '(WHEELSCROLL T))
        (SEDIT:ADD-COMMAND 521 '(WHEELSCROLL))
        (SEDIT:RESET-COMMANDS))])

(LISPINTERRUPTS.WHEELSCROLL
  [LAMBDA NIL                                           (* ; "Edited 15-Feb-2021 14:50 by rmk:")

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

    (APPEND [LIST (LIST 520 '(WHEELSCROLL T))
                  (LIST 521 '(WHEELSCROLL]
           (LISPINTERRUPTS.WSORIG])

(CREATESCROLLBARWINDOW
  [LAMBDA (REGION TITLE BORDERSIZE NOOPENFLG PROPS)     (* ; "Edited 16-Feb-2021 14:37 by rmk:")

    (* ;; "This replaces CREATEW inside SCROLL.HANDLER.  WINDOW should be bound to the window that this scroll bar will control.  The purpose is to create an unreferenced (LOC) pointer from the controller to the controllee, so that wheel scrolling in the scrollbar can be redirected to the controllee.")

    (DECLARE (USEDFREE WINDOW))
    (LET ((SBW (CREATEW REGION TITLE BORDERSIZE NOOPENFLG PROPS)))
         (WINDOWPROP SBW 'CONTROLLEELOC (LOC WINDOW))
         SBW])

(\SCROLLBARTOMAIN?
  [LAMBDA NIL                                           (* ; "Edited 16-Feb-2021 22:13 by rmk:")

    (* ;; "Returns the window that should be wheel scrolled, moving from a scrollbar to its scrollee if necessary.")

    (LET ((W (WHICHW)))
         (CL:WHEN W
             (CL:WHEN (WINDOWPROP W 'CONTROLLEELOC)
                 [SETQ W (VAG (WINDOWPROP W 'CONTROLLEELOC]
                 (GETMOUSESTATE)
                 (\CURSORPOSITION [IPLUS 10 (FETCH LEFT OF (WINDOWPROP W 'REGION]
                        LASTMOUSEY)
                 (SETCURSOR DEFAULTCURSOR)
                 (GETMOUSESTATE)))

         (* ;; "IN/SCROLL/BAR? in WINDOWSCROLL does nothing if the window doesn't have a SCROLLFN, even though SCROLLW applies SCROLLBYREPAINTFN as a default in that case.  So a direct call to SCROLLW might scroll a window that can't be scrolled by moving the mouse into the scrollbar (or so it seems).  If we don't exclude this, then odd things like menus would be scrolled that shouldn't be.")

         (AND (WINDOWPROP W 'SCROLLFN)
              W])
)
(DEFINEQ

(\TEDIT.WHEELSCROLL
  [LAMBDA (UP)                                          (* ; "Edited 16-Feb-2021 22:35 by rmk:")

    (* ;; "Called from the TEDIT.READTABLE when the wheel moves and the caret is in the TEDIT (WHICHW) window or its scrollbar.")

    (LET ((WINDOW (\SCROLLBARTOMAIN?)))
         (CL:WHEN WINDOW
             [PROCESS.EVAL (FIND.PROCESS 'MOUSE)
                    `(SCROLLW ,WINDOW 0 ,(CL:IF UP
                                             (IMINUS WHEELSCROLLDELTA)
                                             WHEELSCROLLDELTA)])])
)

(RPAQ? WHEELSCROLLDELTA 10)
(DECLARE%: DONTEVAL@LOAD DOCOPY 

(INSTALL-WHEELSCROLL)

(ENABLEWHEELSCROLL T)
)
(DECLARE%: DONTCOPY
  (FILEMAP (NIL (875 4891 (ENABLEWHEELSCROLL 885 . 1310) (WHEELSCROLL 1312 . 1636) (INSTALL-WHEELSCROLL 
1638 . 2819) (LISPINTERRUPTS.WHEELSCROLL 2821 . 3170) (CREATESCROLLBARWINDOW 3172 . 3785) (
\SCROLLBARTOMAIN? 3787 . 4889)) (4892 5475 (\TEDIT.WHEELSCROLL 4902 . 5473)))))
STOP
\ No newline at end of file
+(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
diff --git a/lispusers/WHEELSCROLL.LCOM b/lispusers/WHEELSCROLL.LCOM
index 4dca4a1d..f3c48249 100644
Binary files a/lispusers/WHEELSCROLL.LCOM and b/lispusers/WHEELSCROLL.LCOM differ
