Вот такой получился код
function checkKeyPress(e) { 
  var KeyID = String.fromCharCode(e.charCode).toLowerCase();
  document.getElementById(KeyID).style.backgroundColor = "red";
  }
  document.onkeypress = checkKeyPress;
function checkKeyReleased(e)
{ var KeyID = String.fromCharCode(e.keyCode).toLowerCase();
  document.getElementById(KeyID).style.backgroundColor = "white";
}
  document.onkeyup = checkKeyReleased;
Как его можно доработать так, чтобы обрабатывать хотя бы квадратные скобки и знаки препинания на английской раскладке?