Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@kane-thornwyrd
Created December 28, 2011 12:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kane-thornwyrd/1527752 to your computer and use it in GitHub Desktop.
Save kane-thornwyrd/1527752 to your computer and use it in GitHub Desktop.
Keycode handling
if (event.which == null)
char= String.fromCharCode(event.keyCode); // old IE
else if (event.which != 0 && event.charCode != 0)
char= String.fromCharCode(event.which); // All others
else
// special key
@kane-thornwyrd
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment