Inner: X11CommanderOps.ConnectionProc = {
InfoForDevice:
PROC [di: XlInputExtension.DeviceInfo] = {
typeName: Rope.ROPE ¬ Xl.GetAtomName[connection, di.type];
IO.PutF[cmd.out, "Device: %g type: %g name: %g, ", IO.int[di.id], IO.rope[typeName], IO.rope[di.name]];
IO.PutF[cmd.out, "classes: %g\n CurrentUse: %g \n", IO.int[di.numClasses], IO.rope[CurrentUseRope[di.use]]];
FOR l:
LIST
OF
REF XlInputExtension.InputInfo ¬ di.info, l.rest
WHILE l#
NIL
DO
IO.PutF1[cmd.out, " Class: %g \n", IO.rope[InputClassRope[l.first.class]]];
WITH l.first
SELECT
FROM
ki:
REF keyInfo XlInputExtension.InputInfo => {
IO.PutF[cmd.out, " min: %g max: %g, number: %g\n", IO.int[ki.min], IO.int[ki.max], IO.int[ki.number]];
};
bi:
REF buttonInfo XlInputExtension.InputInfo => {
IO.PutF1[cmd.out, " number: %g\n", IO.int[bi.number]];
};
vi:
REF valuatorInfo XlInputExtension.InputInfo => {
IO.PutF[cmd.out, " supportsRelative: %g, supportsAbsolute %g, motionBufferSize: %g", IO.rope[BoolRope[vi.supportsRelative]], IO.rope[BoolRope[vi.supportsAbsolute]], IO.int[vi.motionBufferSize]];
IO.PutF1[cmd.out, ", Axis: %g\n", IO.int[vi.numberOfAxis]];
FOR axis:
INT
IN [0..vi.numberOfAxis)
DO
IO.PutF[cmd.out, " resolution: %g, min %g, max: %g\n", IO.card[vi.axisInfo[axis].resolution], IO.card[vi.axisInfo[axis].min], IO.card[vi.axisInfo[axis].max]];
ENDLOOP
};
ENDCASE => {};
ENDLOOP;
};
count: INT ¬ 0;
list: LIST OF XlInputExtension.DeviceInfo;
list ¬ XlInputExtension.ListInputDevices[connection];
IF list=NIL THEN CommanderOps.Failed["Extension not available (or supports no device)"];
FOR l:
LIST
OF XlInputExtension.DeviceInfo ¬ list, l.rest
WHILE l#
NIL
DO
count ¬ count+1
ENDLOOP;
IO.PutF1[cmd.out, "%g extension devices available\n", IO.int[count]];
FOR l:
LIST
OF XlInputExtension.DeviceInfo ¬ list, l.rest
WHILE l#
NIL
DO
InfoForDevice[l.first];
ENDLOOP;
};