https://github.com/qard/input-event-name
Transform MouseEvent/KeyboardEvent objects to readable names
https://github.com/qard/input-event-name
Last synced: 5 months ago
JSON representation
Transform MouseEvent/KeyboardEvent objects to readable names
- Host: GitHub
- URL: https://github.com/qard/input-event-name
- Owner: Qard
- Created: 2015-04-24T23:34:32.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2017-09-25T02:12:37.000Z (almost 8 years ago)
- Last Synced: 2024-12-31T16:27:55.205Z (6 months ago)
- Language: JavaScript
- Size: 6.84 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# input-event-name
This is a helper to transform MouseEvent and KeyboardEvent instances to a readable/parseable string. It's useful for event-emitter keys.
## Install
```sh
npm install input-event-name
```## Usage
```js
el.addEventListener('keydown', function (e) {
if (eventName.key(e) === 'ctrl+x') {
// Do a thing when both ctrl and x are pressed
}
})
```