Firefox Tomorrow

web api interface

HID

View on MDN ↗

Secure contextLimited availabilityAvailable in workers

The HID interface provides methods for connecting to HID devices, listing attached HID devices and event handlers for connected HID devices.

Instance properties

This interface also inherits properties of its parent, EventTarget.

Instance methods

This interface also inherits methods of its parent, EventTarget.

  • getDevices() Experimental
    • : Returns a Promise that resolves with an array of connected HID devices that the user has previously been granted access to in response to a requestDevice() call.
  • requestDevice() Experimental
    • : Returns a Promise that resolves with an array of connected HIDDevice objects. Calling this function will trigger the user agent’s permission flow in order to gain permission to access one selected device from the returned list of devices.

Events

  • connect Experimental
    • : Fired when an HID device is connected.
  • disconnect Experimental
    • : Fired when an HID device is disconnected.

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.

See also