code: function (evt) {
          // ctrl unpress (add mode off)
          if (evt.keyCode == 17) this.map.div.classList.remove(this.addClass);
          if (evt.keyCode == 67) { // show contours (debug mode)
              var cs = this.maskLayer.tile.getContours();
  
              var ctx = this.maskLayer.tile.canvasContext;
              ctx.clearRect(0, 0, this.maskLayer.tile.size.w, this.maskLayer.tile.size.h);
  
              var i, j, ps;
              // lines
              ctx.beginPath();
              for (i = 0; i < cs.length; i++) {
                  ps = cs[i].points;
                  ctx.moveTo(ps[0].x, ps[0].y);
                  for (j = 1; j < ps.length; j++) {
                      ctx.lineTo(ps[j].x, ps[j].y);
                  }
              }
              ctx.strokeStyle = "red";
              ctx.stroke();
  
              // vertices
              ctx.fillStyle = "aqua";
              for (i = 0; i < cs.length; i++) {
                  ps = cs[i].points;
                  for (j = 0; j < ps.length; j++) {
                      ctx.fillRect(ps[j].x, ps[j].y, 1, 1);
                  }
              }
          }
          if (evt.ctrlKey) { // history manipulations
              var img = null;
              if (evt.keyCode == 89) img = this.history.redo(); // ctrl + y
              if (evt.keyCode == 90) img = this.history.undo(); // ctrl + z
              if (img && this.maskLayer) this.maskLayer.tile.setImage(img); // apply mask from history
          }
      }
docs: private