KnobRotation.mesa
Copyright © 1984, 1985 by Xerox Corporation. All rights reserved.
Created Tuesday, August 7, 1984 8:49 am PDT
Last edited by Eric Nickell, May 25, 1985 12:02:37 pm PDT
KnobRotation: CEDAR DEFINITIONS = BEGIN
KnobIndex: TYPE ~ {left, right};
OffsetSinceLastCall: PROC [knobIndex: KnobIndex, returnZero: BOOLEANFALSE] RETURNS [offset: INTEGER, waitCycles: INT ← 0];
Returns the number of ticks of the physical dial since the last call to this procedure. Note that negative means left-rotation, and positive means right rotation.
returnZero = FALSE => the routine WILL NOT return until the dial has been fiddled with.
returnZero = TRUE => the routine will ALWAYS return immediately.
waitCycles is the number of vertical retraces waited through before knob moved.
InitializeOffset: PROC [knobIndex: KnobIndex] ~ INLINE {
Ignore any rotation on knob #knobIndex up to now.
[] ← OffsetSinceLastCall[knobIndex];
};
END.