Skip to content

incompl/keyDecode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Lets you handle keyboard events without worrying about key codes.

Uses http://unixpapa.com/js/key.html as a starting point.

In progress.

Example:

function keydownEventHandler(e) {
  var key = keyDecode(e);
  if (key === 'f') {
    // Lowercase...
  }
  else if (key === 'F') {
    // ...and uppercase. Normally you'd have to check the shift key.
  }
  else if (key === ';') {
    // The keycode can vary depending on your browser, but don't sweat it.
  }
}

About

Let's pretend keycodes never happened.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published