HIDMKtlDevice provides an internal interface for HID devices you can connect to your computer.
When looking for available devices with MKtl.find(\hid)
, HIDMKtlDevice searches for connected controllers, and returns a list of available devices.
When creating an MKtl by desc name, e.g. MKtl(\x, "*drive");
, HIDMKtlDevice try to find the matching HID in the list of available devices and return it. If it does not find it, e.g. because the physical controller is not there, it will return nil. In that case, the MKtl will be virtual, meaning it has no device, and you can still work with it, because it can open a GUI that can replace the controller.
For most devices, this requires that someone has already made a description file for the device; if there is none, it is easy to make one following the instructions here: How_to_create_a_description_file
More general info can be found in MKtl and MKtlDevice .
On OSX, some devices show up as HID that will cause system crashes when opened. these devices can be excluded from MKtl for safety.
a flag whether to show risky devices or not.
Find all currently connected HID devices.
post |
Whether or not to post about the found HID devices. |
Post all access code for device that could be used by name.
protocol name, \hid.
Look for available HID devices.
force |
Whether or not to do this again if it was already done before. |
Convenience method to create a device name from the information from HIDInfo for idInfo lookup.
get the idInfo string from a HIDInfo object.
Creates a new instance of HIDMKtlDevice.
name |
The short name of the controller as it shows up in the list of found devices. |
path |
The path of the device to open (optional). |
parentMKtl |
The instance of MKtl that this MKtlDevice will belong to. |
multiIndex |
When using multiple identical devices, the index which one to use. |
enable or disable this device.
a boolean whether device is currently enabled.
enable or disable an element in the device by name.
The HID device that is the source of this HIDMKtlDevice.
The uid of the source.
Close the device and clean up anything that it used.
When opening a device that is not known yet by MKtl, you may want to explore the device. See the tutorial How_to_create_a_description_file.
bool |
a flag to turn exploring on or off. |
the flag whether the device is currently being explored or not.
Create and open a description file for this MKtlDevice, after exploring it.
Initialize all elements and hook them up to the hardware elements.
Send the value of an element to this HID device; called if you set the value of an MKtlElement that is an output.
key |
The key of the element. |
val |
The value to which the element is to be set. |