hkeyboard
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

hkeyboard

A keyboard lib.

Usage

// Use as an ES module:
import * as HKB from "hkeyboard";
// or a UMD module:
const HKB = window.HKB;

// Create a keyboard:
const keyboard = new HKB.Keyboard({
    // Automatic listening options:
    target: window,
    options: {},
    // Other options...
});

// Subscribe to shortcuts:
keyboard.on('Esc', () => {
    // ...
}).on('Control+D', () => {
    // ...
}).on('ctrl+shift+l', () => {
    // ...
}).on('ctrl+shift+alt+left', () => {
    // ...
}).on('ctrl+c alt+d', () => {
    // ...
});

// Start listening manually:
keyboard.listenOn(window);

APIs

Please read the declaration files in typings folder or the source files in src folder to learn the APIs.

Changelog

See CHANGELOG.md

Package Sidebar

Install

npm i hkeyboard

Weekly Downloads

1

Version

0.2.0

License

MIT

Unpacked Size

24.7 kB

Total Files

15

Last publish

Collaborators

  • 3h