Class HID
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
NOTE
ExperimentalHID 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
Ondisconnect
[Value("ondisconnect")]
public EventHandlerNonNull Ondisconnect { get; set; }
Property Value
Methods
GetDevices()
NOTE
ExperimentalgetDevices() 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
Remarks
RequestDevice(HIDDeviceRequestOptions)
[Value("requestDevice")]
public Task<List<HIDDevice>> RequestDevice(HIDDeviceRequestOptions options)
Parameters
optionsHIDDeviceRequestOptions
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.