DIRECTORY Menus, Process, SV2d, SVInputMonitor, SVViewerTool, SVViewerInput; SVInputMonitorImpl: MONITOR IMPORTS Process, SVViewerInput EXPORTS SVInputMonitor = BEGIN MouseButton: TYPE = Menus.MouseButton; Point2d: TYPE = SV2d.Point2d; ViewerToolData: TYPE = SVViewerTool.ViewerToolData; globalProcess: PROCESS _ NIL; cameraCoords: Point2d; clickAtom: ATOM; vtData: ViewerToolData _ NIL; globalNew: BOOL _ FALSE; NewMotion: PUBLIC ENTRY PROC [pt: Point2d, atom: ATOM, viewerToolData: ViewerToolData] = { globalNew _ TRUE; cameraCoords _ pt; vtData _ viewerToolData; clickAtom _ atom; IF globalProcess = NIL THEN Process.Detach[globalProcess _ FORK Painter]; }; Painter: PROC = { WHILE New[] DO Dispatch[cameraCoords, clickAtom, vtData]; ENDLOOP; }; New: PUBLIC ENTRY PROC RETURNS [x: BOOL] = { x _ globalNew; globalNew _ FALSE; IF NOT x THEN globalProcess _ NIL; -- no mouse action. Let process die. }; Dispatch: PROC [controlPoint: Point2d, atom: ATOM, viewerToolData: ViewerToolData] = { SELECT atom FROM $SetPrimarySelection => SVViewerInput.SetPrimarySelection[viewerToolData, controlPoint]; $SetSecondarySelection => SVViewerInput.SetSecondarySelection[viewerToolData, controlPoint]; ENDCASE; }; END. šSVInputMonitorImpl.mesa Author: Eric Bier on December 9, 1982 11:33 pm Last edited by Bier on July 1, 1983 5:41 pm Contents: A flexible setup, suggested by Scott McGregor, for processing mouse input as fast as you can (but no faster). I will use it to synchronize my mouse point processing with the mousepoint. If the processing algorithms become faster, this procedure will still do the right thing. Κ!˜Iheadšœ™Jšœ.™.Jšœ+™+JšœŸ™ŸJ˜šΟk ˜ Jšœ˜Jšœ˜Jšœ˜Jšœ˜Jšœ ˜ Jšœ˜—J˜šœ˜Jšœ˜Jšœ˜—Jš˜˜Jšœ œ˜&Jšœ œ˜Jšœ3˜3J˜Jšœœœ˜Jšœ˜Jšœ œ˜Jšœœ˜Jšœ œœ˜J˜š Οn œ œœœœ˜ZJšœ œ˜Jšœ˜Jšœ˜Jšœ˜Jšœœœ œ ˜IJšœ˜—J˜šžœœ˜šœ˜Jšœ*˜*—Jšœ˜Jšœ˜—J˜š žœ œœœœ˜,Jšœ˜Jšœ œ˜Jšœœœœ'˜HJšœ˜—J˜šžœœœ%˜Všœ˜JšœX˜XJšœ\˜\Jšœ˜—Jšœ˜——J˜Jšœ˜J˜J˜—…—Δ