XlInputExtensionKeysImpl.mesa
Copyright Ó 1992 by Xerox Corporation. All rights reserved.
Created by Christian Jacobi, January 6, 1992 12:18:05 pm PST
Christian Jacobi, January 6, 1992 1:04 pm PST
DIRECTORY Xl, XlEndianPrivate, XlInputExtension, XlInputExtensionKeys, XlInputExtensionPrivate, XlKeyButPrivate, XlPrivate;
XlInputExtensionKeysImpl: CEDAR MONITOR
LOCKS c USING c: Xl.Connection
IMPORTS XlInputExtensionPrivate, XlPrivate
EXPORTS XlInputExtensionKeys
SHARES Xl ~
BEGIN OPEN XlInputExtension, XlInputExtensionKeys, XlInputExtensionPrivate;
ChangeKeyboardDevice: PUBLIC PROC [c: Xl.Connection, deviceId: DeviceId] RETURNS [status: ChangeReply] = {
reply: XlPrivate.Reply ¬ NIL;
action: PROC [c: Xl.Connection] = {
XlPrivate.BInit[c, cd.ex.majorOpcode, opChangeKeyboardDevice, 2];
XlPrivate.BPut8[c, deviceId];
XlPrivate.BSkip[c, 3];
reply ¬ XlPrivate.FinishWithReply[c];
};
cd: REF ConnectionData ~ GetConnectionData[c];
IF cd.ex=NIL THEN ERROR;
XlPrivate.DoWithLocks[c, action, NIL];
XlPrivate.Skip[reply, 7];
SELECT XlPrivate.Read8[reply] FROM
0 => status ¬ success;
1 => status ¬ alreadyGrabbed;
ENDCASE => status ¬ deviceFrozen;
};
END.