2 summary:: pattern that polls values from a human device interface, based on a named slot
3 related:: Classes/Phid, Classes/PhidSlot, Classes/GeneralHID
4 categories:: Streams-Patterns-Events>Patterns>User Input
11 key defined in the link::Classes/Spec:: of the device, pointing to a slot like a button or an axis.
14 a link::Classes/GeneralHIDDevice::, or an element from the code::GeneralHID.deviceList::, which will then be opened by the pattern.
17 number of values to return.
22 // build the device list and start the event loop:
23 GeneralHID.buildDeviceList;
24 GeneralHID.startEventLoop;
26 // find an Impact game device and open it:
27 a = GeneralHID.open( GeneralHID.findBy( 1973 ) );
31 a.add( \lx, [3,0]); // left x
32 a.add( \ly, [3,1]); // left y
33 a.add( \rx, [3,2]); // right x
34 a.add( \ry, [3,5]); // right y
36 // or find a spec defined previously for this device:
49 \degree, ( PhidKey( \lx, a, inf )*12 ).round(1),
55 // more complex example, showing multichannel expansion and sequences of slots:
58 \degree, ( PhidKey( Pseq([[\lx,\ly],\rx,\ry],inf), a, inf )*12 ).round(1),
63 // clean up: close the device and stop the eventloop
65 GeneralHID.stopEventLoop;