Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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
}
})
```