class KeyHandler {
  constructor() {
    this.keycode = {
      "ESC": 27,
      "UP": [38, 104],
      "DOWN": [40, 98],
      "LEFT": [37, 100],
      "RIGHT": [39, 102],
      "SPACE": 32,
      "ENTER": 13,
    }
  }

  pressed(e, key) {
    var checked = false;
    for (var k in this.keycode) {
      if (k == key) {
        for (var v in this.keycode[k]) {
          if (e.keyCode == `${this.keycode[k][v]}`) {
            checked = true;
            return checked;
          }
        }
      }
    }
    return checked;
  }
}

@@ -68,10 +68,12 @@
 C%22: 
+%5B
 27
+%5D
 ,%0A  
@@ -187,10 +187,12 @@
 E%22: 
+%5B
 32
+%5D
 ,%0A  
@@ -208,10 +208,12 @@
 R%22: 
+%5B
 13
+%5D
 ,%0A  

fix key handler code