import { Keyboard } from "https://deno.land/x/astral@0.2.1/mod.ts";
Keyboard provides an api for managing a virtual keyboard. The high level api is Keyboard.type()
, which takes raw characters and generates proper keydown
, keypress
/input
, and keyup
events on your page.
Constructors
new
Keyboard(celestial: Celestial)Methods
sendCharacter(char: string)
Dispatches a keypress
and input
event. This does not send a keydown
or keyup
event.
type(text: string | KeyInput[], opts?: KeyboardTypeOptions)
Sends a keydown
, keypress
/input
, and keyup
event for each character in the text.