1.0.3 • Published 10 years ago

input-event-name v1.0.3

Weekly downloads
1
License
MIT
Repository
github
Last release
10 years ago

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

npm install input-event-name

Usage

el.addEventListener('keydown', function (e) {
  if (eventName.key(e) === 'ctrl+x') {
    // Do a thing when both ctrl and x are pressed
  }
})