Tuesday, 10 February 2015

ASCII in json or xml format



I am building a JavaScript application which uses keyboard. Since it will be used in a browser I wanted to avoid non standard features in current ECMAScript supported by major browsers. I got to idea that I should make my own JavaScript/JSON object that will hold letters and numbers from the keyboard so that it will be easy to get the character by just providing a keyCode. Example:



var mapOfKeys = {
65: "A",
66: "B",
67: "C"
}

var currentKey = mapOfKeys[66];


I need both upper case and lower case letters and that is overkill to write all of them manually in my mapping object. Ofcourse I will need numbers too.


Is there a tool that generates or already somebody wrote the complete ASCII standard keyboard in JSON or XML format?


No comments:

Post a Comment