Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nescalante/is-key-combo
checks if event is key combo
https://github.com/nescalante/is-key-combo
Last synced: 20 days ago
JSON representation
checks if event is key combo
- Host: GitHub
- URL: https://github.com/nescalante/is-key-combo
- Owner: nescalante
- License: mit
- Created: 2017-04-29T19:23:32.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-02-09T18:55:12.000Z (almost 2 years ago)
- Last Synced: 2024-10-17T03:27:49.100Z (2 months ago)
- Language: JavaScript
- Size: 43.9 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: readme.md
- License: License
Awesome Lists containing this project
README
# is-key-combo
[![Greenkeeper badge](https://badges.greenkeeper.io/nescalante/is-key-combo.svg)](https://greenkeeper.io/)
Do assertions on given key combos and events and returns true if match
## Install
```
npm install is-key-combo
```## Usage
```js
const isKeyCombo = require('is-key-combo');
const isValid = isKeyCombo(event, 'cmd+a');
```## Some sample combinations
- `cmd+a`
- `cmd+shift+esc`
- `alt+enter`Note that `cmd` applies both for Ctrl and ⌘ so it will be easier to handle combinations cross platform.
## License
MIT