HIDInputReportEvent: reportId property

Khả dụng hạn chế

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

Note: This feature is available in Web Workers, except for Shared Web Workers.

Thuộc tính reportId của giao diện HIDInputReportEvent trả về tiền tố nhận dạng một byte cho báo cáo này, hoặc 0 nếu giao diện HID không sử dụng ID báo cáo.

Giá trị

Một tiền tố nhận dạng một byte.

Ví dụ

Trong ví dụ sau, reportId của báo cáo đầu vào đến được ghi vào console.

js
device.addEventListener("inputreport", (event) => {
  const { data, device, reportId } = event;
  console.log(reportId);
});

Thông số kỹ thuật

Thông số kỹ thuật
WebHID API
# dom-hidinputreportevent-reportid

Tương thích trình duyệt