24.0.1 • Published 1 year ago

@vaadin-component-factory/keyboard-shortcut-manager v24.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

VCF Keyboard Shortcut Manager

npm version Published on Vaadin Directory

A modern library for managing keyboard shortcuts in a Vaadin application (or any framework).

  • Dispatch custom events from keyboard shortcuts.
  • Bind multiple keyboard commands to a single event listener.
  • Easily create simple keyboard shortcut help dialog/popup.
  • Compatible with web components and Shadow DOM.
  • Implemented in TypeScript.

This is a wrapper for the Tinykeys library.

DEMO ↗

API ↗

Install

npm i @vaadin-component-factory/keyboard-shortcut-manager

Usage

Create an array of KeyboardShortcut definitions:

const shortcuts: KeyboardShortcut = [
  {
    keyBinding: 'Control+Shift+?',
    handler: 'help-dialog',
    description: 'Opens the help dialog.'
  }
];

Then create a KeyboardShortcutManager instance and subscribe your shortcuts to activate them:

const ksm = new KeyboardShortcutManager({ shortcuts, helpDialog: true });

ksm.subscribe();

Keybinding Syntax

Refer to the following links for more information on the keybinding syntax:

Publish the component to NPM

npm login

git commit -a -m "v${version}"
npm version ${version}
npm publish --registry https://registry.npmjs.org/
git reset HEAD~2
git commit -a -m "v${version}"
git push
git push origin v${version}

License

Apache-2.0 License

24.0.1

1 year ago

24.0.0

1 year ago

23.3.1

2 years ago

23.3.0

2 years ago

23.2.1

3 years ago

23.2.0

3 years ago

23.1.7

3 years ago

23.1.6

3 years ago

23.1.9

3 years ago

23.1.8

3 years ago

23.1.11

3 years ago

23.1.12

3 years ago

23.1.10

3 years ago

23.1.3

3 years ago

23.1.2

3 years ago

23.1.5

3 years ago

23.1.4

3 years ago

23.1.1

3 years ago

23.1.0

3 years ago

23.0.4

3 years ago

23.0.3

3 years ago

23.0.0

3 years ago

23.0.2

3 years ago

23.0.1

3 years ago

1.0.7-legacy-1

3 years ago

1.0.7

3 years ago

1.0.7-legacy

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago