š for key comb and š„.
npm install key-combo-listenerš for key combo and š„.
With typescript support of course.
With yarn:
```
yarn add key-combo-listener
With npm:
``
npm install key-combo-listener --save
Use it like this:
`javascript
import keyComboListener from 'key-combo-listener';
const keyCombo = ['ArrowUp', 'ArrowDown'];
const timeout = 5000;
const listener = keyComboListener(keyCombo, timeout, result => {
if (result.done) {
return console.log(š„ something!);
}
console.log(keep š, result);
})
document.addEventListener(keydown, listener);`
key-combo-listener` accepts 3 parameters.
| Param | Type | Default Value |
|----------|------------|---------------|
| key comb | string[] | [] |
| timeout | number(ms) | Infinity |
| callback | function | () => null |