Table of Contents

Class HID

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll
NOTE
Experimental
The HID interface provides methods for connecting to HID devices, listing attached HID devices and event handlers for connected HID devices.
[Value("HID")]
public class HID : EventTarget
Inheritance
HID
Inherited Members

Remarks

Constructors

HID()

public HID()

Properties

Onconnect

[Value("onconnect")]
public EventHandlerNonNull Onconnect { get; set; }

Property Value

EventHandlerNonNull

Ondisconnect

[Value("ondisconnect")]
public EventHandlerNonNull Ondisconnect { get; set; }

Property Value

EventHandlerNonNull

Methods

GetDevices()

NOTE
Experimental
The getDevices() method of the HID interface gets a list of connected HID devices that the user has previously been granted access to in response to a RequestDevice(HIDDeviceRequestOptions) call.
[Value("getDevices")]
public Task<List<HIDDevice>> GetDevices()

Returns

Task<List<HIDDevice>>

A {{jsxref("Promise")}} that resolves with a list of HIDDevice objects.

Remarks

RequestDevice(HIDDeviceRequestOptions)

NOTE
Experimental
The requestDevice() method of the HID interface requests access to a HID device.
[Value("requestDevice")]
public Task<List<HIDDevice>> RequestDevice(HIDDeviceRequestOptions options)

Parameters

options HIDDeviceRequestOptions

Returns

Task<List<HIDDevice>>

A {{jsxref("Promise")}} that resolves with an array of connected HIDDevice objects that match the filters passed in.

Remarks

The user agent will present a permission dialog including a list of connected devices, and ask the user to select and grant permission to one of these devices.

See also on MDN