/// testing state!!!
/// still to do:
Get deviceSpecs working
Fix identical numbers between Linux and Mac (this may mean that the slot structure will change!)
GeneralHID is a cross platform wrapper for accessing HID devices.
Currently the MacOSX and Linux HID support has been wrapped.
Some of the code is inspired by the GUI wrapper.
Get the current scheme:
GeneralHID.scheme
GeneralHID.scheme.id
Build a device list:
GeneralHID.buildDeviceList;
Get the device list:
d = GeneralHID.deviceList;
this works also:
d = GeneralHID.buildDeviceList;
Post the devices found:
GeneralHID.postDevices;
Post the devices and their capabilities:
GeneralHID.postDevicesAndProperties;
Start the event loop with rate (default is 0.005):
GeneralHID.startEventLoop( 0.002 );
Stop the event loop:
GeneralHID.stopEventLoop;
Check status of eventloop:
GeneralHID.eventLoopIsRunning;
Open a device:
a = GeneralHID.open( d[2] );
You need to take a device that shows up in the DeviceTable. You can do any kind of automatic detection to always get the device you want (e.g. on vendor and product id's)
Get the device info:
a.info;
Check whether device is open:
a.isOpen;
A dictionary with all slots:
a.slots;
The devices capabilities in a more readable form:
a.caps;
See if data is coming in:
a.debug_( true );
Turn it off again:
a.debug_( false );
(debugging can be turned on for each slot individually, if necessary)
Actions can be mapped to each slot individually.
// close the device:
a.close;