Skip to main content
Module

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

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

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

Examples

Example 1

const saveKeyCombo = KeyCombo.parse('Ctrl+S')
if (saveKeyCombo.test(keypress)) {
  event.preventDefault()
  console.log('Saving...')
}

Parameters

event: Keypress

The event to test this key combo against.

Returns

boolean

True if the keys in the event matches the key combo.