npm.io
1.0.3 • Published 11 years ago

input-event-name

Licence
MIT
Version
1.0.3
Deps
0
Vulns
0
Weekly
0

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