This interface is implemented by HID Manager.
interface IHIDManager {
// Properties
readonly ${devices}: ${IHIDDevice}[];
${sessions}: ${IHIDSession}[];
// Methods
${createSession#cs1}(device: ${IHIDDevice}): ${IHIDSession};
${createSession#cs2}(deviceKey: string): ${IHIDSession};
${createSession#cs3}(vendorId: number,
productId: number,
searchOptions?: { serialNumber?: string; usage?: number; usagePage?: number }): ${IHIDSession};
${closeAllSessions}(): void;
}
// This interface is not available in managed environment
// This interface is not available in native environment
readonly devices: ${IHIDDevice}[];
// This property is not available in managed environment
// This property is not available in native environment
Returns the array of HID device objects.
Obtain a list of detected HID devices and their information:
var devices = hid.devices;
for (var i = 0; i < devices.length; ++i)
alert(devices[i].vendorId + "." + devices[i].productId);
sessions: ${IHIDSession}[];
// This property is not available in managed environment
// This property is not available in native environment
Returns the array of HID session objects.
Obtain a list of HID sessions and print their corresponding device information:
var sessions = hid.sessions;
for (var i = 0; i < sessions.length; ++i)
alert(devices[i].vendorId + "." + devices[i].productId);
createSession(device: ${IHIDDevice}): ${IHIDSession};
// This method is not available in managed environment
// This method is not available in native environment
device
Returns the reference to created session object.
Creates new HID session.
Create new HID session:
var session1 = hid.createSession(hid.devices[0]);
createSession(deviceKey: string): ${IHIDSession};
// This method is not available in managed environment
// This method is not available in native environment
deviceKey
Returns the reference to created session object.
Creates new HID Session.
createSession(vendorId: number,
productId: number,
searchOptions?: { serialNumber?: string; usage?: number; usagePage?: number }): ${IHIDSession};
// This method is not available in managed environment
// This method is not available in native environment
vendorId
productId
searchOptions
Returns the reference to created session object.
Creates new HID Session.
Create new HID session:
var session = hid.createSession(0x1234, 0x5678, { serialNumber: "XXX0001" });
closeAllSessions(): void;
// This method is not available in managed environment
// This method is not available in native environment
Stops and closes all running HID sessions.