Created
May 29, 2015 12:17
-
-
Save jasdeepkhalsa/dabf55b8b906bc96529d to your computer and use it in GitHub Desktop.
Event Handler (Cross-Browser - IE9+)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function onKey(evt) { | |
var key = evt.which || evt.charCode || evt.keyCode; | |
switch (key) { | |
case 67: | |
break; | |
case 18: | |
break; | |
default: | |
break; | |
} | |
}; | |
document.addEventListener('keydown', onKey, false); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment