Detect keyboard event type from KeyboardEvent.
npm install key-string
import KeyStringDetector from 'key-string'
const detector = new KeyStringDetector();
document.addEventListener('keydown', (event) => {
console.log(detector.detect(event)); //=> "Alt+Ctrl+Return"
});
Import in your favorite style.
// Pattern 1: Using a default export
import KeyStringDetector from 'key-string'
// Pattern 2: Using named exports
import { KeyStringDetector, keyStringMap } from 'key-string'
// Pattern 3: Using both a default export and named exports
import KeyStringDetector, { keyStringMap } from 'key-string'
# Set up
npm install
# Compile JavaScript files
npm run compile
# Watch changes of JavaScript files
npm run watch
# Run tests
npm run test