HIDInputReportEvent: device property
WebHID APIwindowandworkerexceptshared
WebHID APIwindow_and_worker_except_shared
The device property of the HIDInputReportEvent interface returns the HIDDevice instance that represents the HID interface that sent the input report.
Value
An HIDDevice.
Examples
In the following example device is a HIDDevice instance, representing the device sending the report. The productName of this device is logged to the console.
device.addEventListener("inputreport", (event) => {
const { data, device, reportId } = event;
console.log(device.productName);
});