Skip to main content
Module

x/cliffy/keypress/mod.ts>Keypress

Command line framework for deno 🦕 Including Commandline-Interfaces, Prompts, CLI-Table, Arguments Parser and more...
Extremely Popular
Latest
class Keypress
implements AsyncIterableIterator<KeyPressEvent>, PromiseLike<KeyPressEvent>
extends EventTarget
import { Keypress } from "https://deno.land/x/cliffy@v1.0.0-rc.4/keypress/mod.ts";

Keypress class.

Properties

readonly
disposed: boolean

Indicates if event loop is disposed.

Methods

addEventListener(
type: "keydown",
options?: boolean | AddEventListenerOptions,
): void

Add keydown event listener.

dispose(error?: Error)

Dispose event loop.

next(): Promise<IteratorResult<KeyPressEvent>>
removeEventListener(
type: "keydown",
options?: EventListenerOptions | boolean,
): void

Remove keydown event listener.

then<T, S>(f: (v: KeyPressEvent) => T | Promise<T>, g?: (v: Error) => S | Promise<S>): Promise<T | S>
[Symbol.asyncIterator](): AsyncIterableIterator<KeyPressEvent>