Skip to main content

HidKeyboard

Control a HID keyboard.

The codes for the key (selectors) is defined in the HID Keyboard specification, chapter 10 Keyboard/Keypad Page, page 81. Modifiers are in page 87.

The device keeps tracks of the key state and is able to clear it all with the clear command.

import { HidKeyboard } from "@devicescript/core"

const hidKeyboard = new HidKeyboard()

Commands

clear

Clears all pressed keys.

hidKeyboard.clear(): Promise<void>