//TODO write standard keyboard layout.

var typewriter_codes = {
    '81': {'x': 124, 'y': -100, 'standard': 'q', 'shift': 'Q', 'ctrl': '1', 'label': 'Q'},
    '65': {'x': 114, 'y': -108, 'standard': 'a', 'shift': 'A', 'ctrl': '@', 'label': 'A'}, 
    '90': {'x': 105, 'y': -115, 'standard': 'z', 'shift': 'Z', 'ctrl': '(','label': 'Z'}, 
    '87': {'x': 95, 'y': -121, 'standard': 'w', 'shift': 'W', 'ctrl': '2','label': 'W'}, 
    '83': {'x': 87, 'y': -125, 'standard': 's', 'shift': 'S', 'ctrl': '$','label': 'S'}, 
    '88': {'x': 81, 'y': -129, 'standard': 'x', 'shift': 'X', 'ctrl': ')','label': 'X'}, 
    '69': {'x': 71, 'y': -130, 'standard': 'e', 'shift': 'E', 'ctrl': '3','label': 'E'}, 
    '68': {'x': 62, 'y': -136, 'standard': 'd', 'shift': 'D', 'ctrl': '%','label': 'D'}, 
    '67': {'x': 53, 'y': -139, 'standard': 'c', 'shift': 'C', 'ctrl': '?','label': 'C'}, 
    '82': {'x': 44, 'y': -142, 'standard': 'r', 'shift': 'R', 'ctrl': '4','label': 'R'}, 
    '70': {'x': 34, 'y': -144, 'standard': 'f', 'shift': 'F', 'ctrl': '!','label': 'F'}, 
    '86': {'x': 24, 'y': -146, 'standard': 'v', 'shift': 'V', 'ctrl': '\'','label': 'V'}, 
    '84': {'x': 14, 'y': -146, 'standard': 't', 'shift': 'T', 'ctrl': '5','label': 'T'}, 
    '71': {'x': 6, 'y': -145, 'standard': 'g', 'shift': 'G', 'ctrl': '_','label': 'G'}, 
    '66': {'x': -5, 'y': -145, 'standard': 'b', 'shift': 'B', 'ctrl': '"','label': 'B'}, 
    '89': {'x': -14, 'y': -144, 'standard': 'y', 'shift': 'Y', 'ctrl': '6','label': 'Y'}, 
    '72': {'x': -23, 'y': -141, 'standard': 'h', 'shift': 'H', 'ctrl': '*','label': 'H'}, 
    '78': {'x': -33, 'y': -141, 'standard': 'n', 'shift': 'N', 'ctrl': ':','label': 'N'}, 
    '85': {'x': -42, 'y': -140, 'standard': 'u', 'shift': 'U', 'ctrl': '7','label': 'U'}, 
    '74': {'x': -53, 'y': -138, 'standard': 'j', 'shift': 'J', 'ctrl': '/','label': 'J'}, 
    '77': {'x': -61, 'y': -135, 'standard': 'm', 'shift': 'M', 'ctrl': ';','label': 'M'}, 
    '73': {'x': -70, 'y': -131, 'standard': 'i', 'shift': 'I', 'ctrl': '8','label': 'I'}, 
    '75': {'x': -79, 'y': -129, 'standard': 'k', 'shift': 'K', 'ctrl': '-','label': 'K'}, 
    '188':{'x': -87, 'y': -124, 'standard': ',', 'shift': '&', 'ctrl': '&','label': 'comma'},
    '79': {'x': -97, 'y': -121, 'standard': 'o', 'shift': 'O', 'ctrl': '9','label': 'O'}, 
    '76': {'x': -110, 'y': -115, 'standard': 'l', 'shift': 'L', 'ctrl': '#','label': 'L'}, 
    '190':{'x': -118, 'y': -107, 'standard': '.', 'shift': '.', 'ctrl': '.','label': 'period'},
    '80': {'x': -130, 'y': -100, 'standard': 'p', 'shift': 'P', 'ctrl': '0','label': 'P'},  
    '32': {'x': null, 'y': null, 'standard': '&nbsp;', 'shift': '&nbsp;', 'ctrl': '&nbsp;','label': 'spacebar'}  
};

var standard_codes = {
    '9': {'x': null, 'y': null, 'standard': '\u00A0\u00A0\u00A0\u00A0', 'shift': '\u00A0\u00A0\u00A0\u00A0', 'ctrl': '\u00A0\u00A0\u00A0\u00A0', 'label': 'spacebar'},
    '49': {'x': 124, 'y': -100, 'standard': '1', 'shift': '!', 'ctrl': '!', 'label': 'Q'},
    '50': {'x': 95, 'y': -121, 'standard': '2', 'shift': '@', 'ctrl': '@', 'label': 'W'},
    '51': {'x': 71, 'y': -130, 'standard': '3', 'shift': '#', 'ctrl': '#', 'label': 'E'},
    '52': {'x': 44, 'y': -142, 'standard': '4', 'shift': '$', 'ctrl': '$', 'label': 'R'},
    '53': {'x': 14, 'y': -146, 'standard': '5', 'shift': '%', 'ctrl': '%', 'label': 'T'},
    '54': {'x': -14, 'y': -144, 'standard': '6', 'shift': '^', 'ctrl': '^', 'label': 'Y'},
    '55': {'x': -42, 'y': -140, 'standard': '7', 'shift': '&amp;', 'ctrl': '&amp;', 'label': 'U'},
    '56': {'x': -70, 'y': -131, 'standard': '8', 'shift': '*', 'ctrl': '*', 'label': 'I'},
    '57': {'x': -97, 'y': -121, 'standard': '9', 'shift': '(', 'ctrl': '(', 'label': 'O'},
    '48': {'x': -130, 'y': -100, 'standard': '0', 'shift': ')', 'ctrl': ')', 'label': 'P'},
    '189': {'x': -79, 'y': -129, 'standard': '-', 'shift': '_', 'ctrl': '_', 'label': 'K'},
    '187': {'x': -79, 'y': -129, 'standard': '=', 'shift': '+', 'ctrl': '+', 'label': 'K'},
    '219': {'x': -97, 'y': -121, 'standard': '[', 'shift': '{', 'ctrl': '{', 'label': 'O'},
    '221': {'x': -97, 'y': -121, 'standard': ']', 'shift': '}', 'ctrl': '}', 'label': 'O'},
    '220': {'x': 24, 'y': -146, 'standard': '\\', 'shift': '|', 'ctrl': '|', 'label': 'V'},
    '186': {'x': -61, 'y': -135, 'standard': ';', 'shift': ':', 'ctrl': ':', 'label': 'M'},
    '222': {'x': 24, 'y': -146, 'standard': '\'', 'shift': '"', 'ctrl': '"', 'label': 'V'},
    '191': {'x': -53, 'y': -138, 'standard': '/', 'shift': '?', 'ctrl': '?', 'label': 'J'},
    
    '81': {'x': 124, 'y': -100, 'standard': 'q', 'shift': 'Q', 'ctrl': 'Q', 'label': 'Q'},
    '65': {'x': 114, 'y': -108, 'standard': 'a', 'shift': 'A', 'ctrl': 'A', 'label': 'A'}, 
    '90': {'x': 105, 'y': -115, 'standard': 'z', 'shift': 'Z', 'ctrl': 'Z','label': 'Z'}, 
    '87': {'x': 95, 'y': -121, 'standard': 'w', 'shift': 'W', 'ctrl': 'W','label': 'W'}, 
    '83': {'x': 87, 'y': -125, 'standard': 's', 'shift': 'S', 'ctrl': 'S','label': 'S'}, 
    '88': {'x': 81, 'y': -129, 'standard': 'x', 'shift': 'X', 'ctrl': 'X','label': 'X'}, 
    '69': {'x': 71, 'y': -130, 'standard': 'e', 'shift': 'E', 'ctrl': 'E','label': 'E'}, 
    '68': {'x': 62, 'y': -136, 'standard': 'd', 'shift': 'D', 'ctrl': 'D','label': 'D'}, 
    '67': {'x': 53, 'y': -139, 'standard': 'c', 'shift': 'C', 'ctrl': 'C','label': 'C'}, 
    '82': {'x': 44, 'y': -142, 'standard': 'r', 'shift': 'R', 'ctrl': 'R','label': 'R'}, 
    '70': {'x': 34, 'y': -144, 'standard': 'f', 'shift': 'F', 'ctrl': 'F','label': 'F'}, 
    '86': {'x': 24, 'y': -146, 'standard': 'v', 'shift': 'V', 'ctrl': 'V','label': 'V'}, 
    '84': {'x': 14, 'y': -146, 'standard': 't', 'shift': 'T', 'ctrl': 'T','label': 'T'}, 
    '71': {'x': 6, 'y': -145, 'standard': 'g', 'shift': 'G', 'ctrl': 'G','label': 'G'}, 
    '66': {'x': -5, 'y': -145, 'standard': 'b', 'shift': 'B', 'ctrl': 'B','label': 'B'}, 
    '89': {'x': -14, 'y': -144, 'standard': 'y', 'shift': 'Y', 'ctrl': 'Y','label': 'Y'}, 
    '72': {'x': -23, 'y': -141, 'standard': 'h', 'shift': 'H', 'ctrl': 'H','label': 'H'}, 
    '78': {'x': -33, 'y': -141, 'standard': 'n', 'shift': 'N', 'ctrl': 'N','label': 'N'}, 
    '85': {'x': -42, 'y': -140, 'standard': 'u', 'shift': 'U', 'ctrl': 'U','label': 'U'}, 
    '74': {'x': -53, 'y': -138, 'standard': 'j', 'shift': 'J', 'ctrl': 'J','label': 'J'}, 
    '77': {'x': -61, 'y': -135, 'standard': 'm', 'shift': 'M', 'ctrl': 'M','label': 'M'}, 
    '73': {'x': -70, 'y': -131, 'standard': 'i', 'shift': 'I', 'ctrl': 'I','label': 'I'}, 
    '75': {'x': -79, 'y': -129, 'standard': 'k', 'shift': 'K', 'ctrl': 'K','label': 'K'}, 
    '188':{'x': -87, 'y': -124, 'standard': ',', 'shift': '&lt;', 'ctrl': '&lt;','label': 'comma'},
    '79': {'x': -97, 'y': -121, 'standard': 'o', 'shift': 'O', 'ctrl': 'O','label': 'O'}, 
    '76': {'x': -110, 'y': -115, 'standard': 'l', 'shift': 'L', 'ctrl': 'L','label': 'L'}, 
    '190':{'x': -118, 'y': -107, 'standard': '.', 'shift': '>', 'ctrl': '>','label': 'period'},
    '80': {'x': -130, 'y': -100, 'standard': 'p', 'shift': 'P', 'ctrl': 'P','label': 'P'},  
    '32': {'x': null, 'y': null, 'standard': '&nbsp;', 'shift': '&nbsp;', 'ctrl': '&nbsp;','label': 'spacebar'}  
}

//y 374
//x 460