Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/netzo/deps/question/KeyCombo.ts>default

Full-stack Deno framework for building business web apps like internal tools, dashboards, admin panels and automated workflows.
Go to Latest
class default
import { default } from "https://deno.land/x/netzo@0.5.14/deps/question/KeyCombo.ts";

A class that represents a key combination of modifier keys and maybe a normal key.

Constructors

new
default(unnamed 0?: KeyComboParams)

Creates a new KeyCombo instance.

Properties

readonly
alt: boolean
readonly
command
readonly
ctrl: boolean
readonly
key: string
readonly
meta: boolean
readonly
option
readonly
shift: boolean
readonly
super
readonly
win

Methods

Get the string parts for this key combo.

Get the string parts for a Linux / Unix system of this key combo.

Get the string parts for a MacOS system of this key combo.

Get the string parts for a Windows system of this key combo.

test(event: Keypress): boolean

Test this key combination against a keyboard event. These events might come from events such as keydown and keyup.

Get the string representation for this key combo.

Get a string representation of this key combination for Linux / Unix systems.

Get a string representation of this key combination for MacOS systems.

Get a string representation of this key combination for Windows systems.

Static Methods

from(event: Keypress): KeyCombo

Creates a KeyCombo instance from a keyboard event.

parse(str: string): KeyCombo

Parses a key combination from a string. The string should be in a format of modifier keys and then an actual key. To separate different keys use a plus (+). Modifier keys are Ctrl, Shift, Alt (Option), and the meta key. The meta modifier key is represented as windows logo, or on mac the text command, can be represented as Command, Super, or Win.