UserInputInsertActions.mesa
Copyright Ó 1990, 1991, 1992 by Xerox Corporation. All rights reserved.
Bier, July 17, 1990 10:21 pm PDT
Christian Jacobi, February 24, 1992 11:20 am PST
Contents: UserInputInsertActions provides an way to allow a rich and extensible set of actions being input to an UserInput Handle.
DIRECTORY
KeyTypes USING [KeyCode, KeySym],
RelativeTimes USING [TimeStamp],
UserInput USING [Handle],
UserInputTypes USING [Acceptance];
UserInputInsertActions: 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;
in milliseconds, relative to an arbitrary per-handle starting point.
Inserting actions of client interest
InsertTimeIsPassing: PROC [handle: Handle, deltaTime: DeltaTime, data: REF ¬ NIL, eventSource: REF READONLY ANY ¬ NIL];
Notifies UserInput that deltaTime milliseconds have passed since the last insertion.
InsertKey: PROC [handle: Handle, deltaTime: DeltaTime, down: BOOL, keyCode: KeyCode ¬ NULL, preferredSym: KeySym ¬ [0], device: REF ¬ NIL, user: REF ¬ NIL, data: REF ¬ NIL, eventSource: REF READONLY ANY ¬ NIL];
The physical key "keyCode" has gone down. preferredSym is the KeySym of the character that a user familiar with this keyboard would expect to be echoed when typing to a text editor. "device" describes which physical keyboard is being used. If device = NIL, the main keyboard is assumed. If user = NIL, the currently logged-in user is assumed. "data" is just passed on to the client.
InsertIntegerPosition: PROC [handle: Handle, deltaTime: DeltaTime, x, y: INTEGER, device: REF ¬ NIL, user: REF ¬ NIL, display: REF ¬ NIL, data: REF ¬ NIL, eventSource: REF READONLY ANY ¬ NIL];
Insert a position (mouse, pen, or tablet) action on the queue. deltaTime is the time in milliseconds since the last action was inserted. If device = NIL, the primary mouse is assumed. If user = NIL, the currently logged-in user is assumed. If display = NIL, the cursor is assumed to be on the primary display device. "data" is just passed on to the client.
InsertPosition: PROC [handle: Handle, deltaTime: DeltaTime, x, y: REAL, device: REF ¬ NIL, user: REF ¬ NIL, display: REF ¬ NIL, data: REF ¬ NIL, eventSource: REF READONLY ANY ¬ NIL];
Like InsertIntegerPosition, but allows the position to be specified in floating point.
InsertFakePosition: PROC [handle: Handle, deltaTime: DeltaTime, device: REF ¬ NIL, user: REF ¬ NIL, display: REF ¬ NIL, data: REF ¬ NIL, eventSource: REF READONLY ANY ¬ NIL];
Like, InsertIntegerPosition but does not actually move the cursor position. This is used to, for instance, to restore the cursor pattern after a pop-up menu goes away.
InsertEnter: PROC [handle: Handle, deltaTime: DeltaTime, device: REF ¬ NIL, user: REF ¬ NIL, display: REF ¬ NIL, data: REF ¬ NIL, eventSource: REF READONLY ANY ¬ NIL];
The named user has caused the named device to enter the ViewersWorld running on the named display. "data" is just passed on to the client.
InsertExit: PROC [handle: Handle, deltaTime: DeltaTime, device: REF ¬ NIL, user: REF ¬ NIL, display: REF ¬ NIL, data: REF ¬ NIL, eventSource: REF READONLY ANY ¬ NIL];
The named user has caused the named device to exit the ViewersWorld running on the named display. "data" is just passed on to the client.
InsertRef: PROC [handle: Handle, deltaTime: DeltaTime, ref: REF, acceptance: Acceptance, device: REF ¬ NIL, user: REF ¬ NIL, data: REF ¬ NIL, eventSource: REF READONLY ANY ¬ NIL];
A catch-all event for extensibility. Emergencies only. Please consider introducing a new routine rather than using this facility. "data" is just passed on to the client.
Inserting actions that set up UserInput or help debugging
InsertEventTime: PROC [handle: Handle, eventTime: TimeStamp, data: REF ¬ NIL, eventSource: REF READONLY ANY ¬ NIL];
Notifies UserInput that the last event occurred at the given time. This allows UserInput's clock to be set. "data" is just passed on to the client. Usually, clients of UserInputGetActions.GetInputAction will not be interested in events of this type.
InsertAllUp: PROC [handle: Handle, deltaTime: DeltaTime, device: REF ¬ NIL, user: REF ¬ NIL, data: REF ¬ NIL, eventSource: REF READONLY ANY ¬ NIL];
Informs UserInput that all of the keys of the named keyboard are up. This can be used to make sure that the device drivers and UserInput have the same idea about the current state of the keyboard. "data" is just passed on to the client. Usually, clients of UserInputGetActions.GetInputAction will not be interested in events of this type.
InsertKeyStillDown: PROC [handle: Handle, deltaTime: DeltaTime, keyCode: KeyCode ¬ NULL, preferredSym: KeySym ¬ [0], device: REF ¬ NIL, user: REF ¬ NIL, data: REF ¬ NIL, eventSource: REF READONLY ANY ¬ NIL];
Used along with InsertAllUp. Informs UserInput that some of the keys are down. This can be used to make sure that the device drivers and UserInput have the same idea about the current state of the keyboard. "data" is just passed on to the client. Usually, clients of UserInputGetActions.GetInputAction will not be interested in events of this type.
InsertEnd: PROC [handle: Handle, deltaTime: DeltaTime, data: REF ¬ NIL, eventSource: REF READONLY ANY ¬ NIL];
No more input will be coming. Used for debugging. "data" is just passed on to the client.
END.