import { keypress, KeyPressEvent } from "../keypress/mod.ts";
const event: KeyPressEvent = await keypress();console.log("Key pressed: %s", event.key);
for await (const event: KeyPressEvent of keypress()) { console.log("Key pressed: %s", event.key); if (event.ctrlKey && event.key === "c") { console.log("exit"); break; }}
keypress().addEventListener("keydown", (event: KeyPressEvent) => { console.log("Key pressed: %s", event.key); if (event.ctrlKey && event.key === "c") { console.log("exit"); keypress().dispose(); }});