/ Published in: JavaScript
to use this function send in an ASCII character code (use my getKeyCode function) it will return true if the code corresponds to a printable character (not backspace code - 8, enter code - 13, or "undefined")
Expand |
Embed | Plain Text
function pressedPrintableChar(code) { if (code != 8 && code != 13 && code + "" != "undefined") return true; return false; }
Comments
Subscribe to comments
You need to login to post a comment.

what about punctuation and non-printable characters?
I guess that the function should probably be named something else. punctuation returns true and non printable characters return false because the code should be "undefined" if you get the code from my getKeyCode function