<<>> <> <> <> <> <<>> <> <<>> DIRECTORY KeyTypes USING [KeyCode, KeySym], RelativeTimes USING [TimeStamp], UserInput USING [Handle], UserInputTypes USING [Acceptance, WaitMode]; UserInputGetActions: CEDAR DEFINITIONS = BEGIN Acceptance: TYPE ~ UserInputTypes.Acceptance; DeltaTime: TYPE ~ INT32; -- in milliseconds. Handle: TYPE ~ UserInput.Handle; KeyCode: TYPE ~ KeyTypes.KeyCode; KeySym: TYPE ~ KeyTypes.KeySym; TimeStamp: TYPE ~ RelativeTimes.TimeStamp; <> WaitMode: TYPE ~ UserInputTypes.WaitMode; <> <<>> GetInputAction: PROC [handle: Handle, waitMode: WaitMode ¬ forever, waitInterval: DeltaTime ¬ 100, acceptance: Acceptance ¬ all] RETURNS [a: InputAction]; <> GetInputActionBody: PROC [handle: Handle, waitMode: WaitMode ¬ forever, waitInterval: DeltaTime ¬ 100, acceptance: Acceptance ¬ all] RETURNS [a: InputActionBody]; <> <<>> InputAction: TYPE = REF InputActionBody; InputActionBody: TYPE = RECORD [ kind: ATOM ¬ $TimeOut, eventTime: TimeStamp, deltaTime: DeltaTime, device: REF ¬ NIL, user: REF ¬ NIL, data: REF ¬ NIL, down: BOOL ¬ TRUE, keyCode: KeyCode ¬ NULL, preferredSym: KeySym ¬ [0], x, y: INTEGER ¬ 0, rx, ry: REAL ¬ 0.0, display: REF ¬ NIL, eventSource: REF READONLY ANY ¬ NIL, ref: REF ¬ NIL ]; <> <<>> <<$TimeOut => no valid fields; acceptance = clicks, clicksAndMotion, or all.>> <<$EventTime => eventTime, data are valid; acceptance = all.>> <<$TimeIsPassing => deltaTime, data are valid; acceptance = all.>> <<$End => deltaTime, data are valid; acceptance = clicks, clicksAndMotion, or all.>> <<$AllUp => deltaTime, device, data are valid; acceptance = all.>> <<$KeyStillDown => deltaTime, keyCode, device, data are valid; acceptance = all.>> <<>> <<$Key => deltaTime, device, user, data, down, keyCode, preferredSym are valid; acceptance = clicks, clicksAndMotion, or all.>> <<$IntegerPosition => deltaTime, device, user, data, x, y, display are valid; acceptance = clicksAndMotion or all.>> <<$Position => deltaTime, device, user, data, rx, ry, display are valid; acceptance = clicksAndMotion or all.>> <<$FakePosition => deltaTime, device, user, data, display are valid; acceptance = clicksAndMotion or all.>> <<$Enter => deltaTime, device, user, data, display are valid; acceptance = clicksAndMotion or all.>> <<$Exit => deltaTime, device, user, data, display are valid; acceptance = clicksAndMotion or all.>> <<$Ref => deltaTime, device, user, data, ref are valid; acceptance = .>> <> <<>> <> InsertInputAction: PROC [handle: Handle, a: InputAction]; <> <<>> InsertInputActionBody: PROC [handle: Handle, a: InputActionBody]; <> LogNewActions: PROC [handle: Handle, logger: NewLoggingProc ¬ NIL]; <> NewLoggingProc: TYPE = PROC [a: InputActionBody]; END.