Skip to content

Qard/input-event-name

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Transform MouseEvent/KeyboardEvent objects to readable names

Resources

Stars

Watchers

Forks

Packages

No packages published