Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/qard/input-event-name
Transform MouseEvent/KeyboardEvent objects to readable names
https://github.com/qard/input-event-name
Last synced: 12 days 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 (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-09-25T02:12:37.000Z (about 7 years ago)
- Last Synced: 2024-10-19T19:55:48.513Z (about 1 month 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
}
})
```