HIDConnectionEvent()
Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
The HIDConnectionEvent() constructor creates a new HIDConnectionEvent object. Typically this constructor is not used as events are created when an input report is received.
Syntax
new HIDConnectionEvent(type, HIDConnectionEventInit);
Parameters
type-
A
DOMStringwith one of"connect"or"disconnect". HIDConnectionEventInit-
A dictionary including the following fields:
device-
The
HIDDeviceinstance representing the device sending the input report. -
bubblesOptional -
A boolean value indicating whether the event bubbles. The default is
false. -
cancelableOptional -
A boolean value indicating whether the event can be cancelled. The default is
false. -
composedOptional -
A boolean value indicating whether the event will trigger listeners outside of a shadow root (see
Event.composedfor more details). The default isfalse.
Specifications
| Specification |
|---|
| WebHID API # dom-hidconnectionevent-constructor |
Browser compatibility
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
HIDConnectionEvent |
89 |
89 |
No |
No |
75 |
No |
No |
No |
No |
No |
No |
No |
© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/HIDConnectionEvent/HIDConnectionEvent