HIDInputReportEvent:device 属性
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
备注: 此特性在 Web Worker(不包括共享 Web Worker)中可用。
HIDInputReportEvent
接口的 device
属性返回表示发送输入报告的 HID 接口的 HIDDevice
实例。
值
一个 HIDDevice
。
示例
以下示例中 device
是一个 HIDDevice
实例,表示发送报告的设备。此设备的 productName
会被记录到控制台。
js
device.addEventListener("inputreport", (event) => {
const { data, device, reportId } = event;
console.log(device.productName);
});
规范
Specification |
---|
WebHID API # dom-hidinputreportevent-device |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
device |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
- Experimental. Expect behavior to change in the future.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.