Package Exports
- hkeyboard
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (hkeyboard) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
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