MDN self-hosted library · e01.org

HIDInputReportEvent: device property

WebHID APIwindowandworkerexceptshared

Open notebook · 1 cells web-api-instance-property upstream source

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);
});

Specifications

Browser compatibility