KeyboardClass
class provides methods to emulate keyboard input
class KeyboardClass extends TypedEventEmitter<KeyboardInputEvents, this>Properties
| Name | Type | Description |
|---|---|---|
config | KeyboardConfig | Config object for class(default: ...) |
Methods
pressKey
pressKey(keys: Key[]): Promise<KeyboardClass>presses a single or combinations
Modifier s are to be given in "natural" ordering, so first modifier s, followed by the to press
**ATTENTION**: There's a difference how regular keys are handled vs. modifier keys.
Modifier keys will be held until released via is called.
This means that a modifier key is applied to all subsequent regular key inputs until it is released.
Regular keys, on the other hand, are not held until released, so there's no automatic key repeat.
If you want to have something like key repeat, please use instead.
Parameters
Returns
Promise<KeyboardClass>releaseKey
releaseKey(keys: Key[]): Promise<KeyboardClass>releases a single or combinations
Modifier s are to be given in "natural" ordering, so first modifier s, followed by the to release
**ATTENTION**: There's a difference how regular keys are handled vs. modifier keys.
Modifier keys will be held until released via is called.
This means that, in contrast to regular keys, a modifier key has to be explicitly released
Parameters
Returns
Promise<KeyboardClass>type
type(input: StringOrKey): Promise<KeyboardClass>types a sequence of or single s via system keyboard
Parameters
inputStringOrKeySequence of or to typeReturns
Promise<KeyboardClass>Was this page helpful?