var keys = [];
var pkey = [];
var rkey = [];

keyPressed = function() {
    pkey[keyCode]  = 0;
    if (keys[keyCode] === false) {
      pkey[keyCode]  ++;
    }
    keys[keyCode] = true;
    if (keys[keyCode] === true) {
      pkey[keyCode] ++;
    }
    if (pkey[keyCode] === 2) {pkey[keyCode] = true;} else {pkey[keyCode] = false;}
};
keyReleased = function() {
    rkey[keyCode] = 0;
    if (keys[keyCode] === true) {
      rkey[keyCode] ++;
    }
    keys[keyCode] = false;
    if (keys[keyCode] === false) {
      rkey[keyCode] ++;
    }
    if (rkey[keyCode] === 2) {rkey[keyCode] = true;} else {rkey[keyCode] = false;}
};
function rotateIt(cx, cy, x, y, angle) {
    var radians = (Math.PI / 180) * angle,
      cos = Math.cos(radians),
      sin = Math.sin(radians),
      nx = (cos * (x - cx)) + (sin * (y - cy)) + cx,
      ny = (cos * (y - cy)) - (sin * (x - cx)) + cy;
      return [nx, ny];
}
@@ -38,17 +38,173 @@
 y = %5B%5D;%0A
+var whichKey = null;%0Avar mouseFrame = false;%0AmousePressed = function() %7B%0A  mouseFrame = false;%0A  if (mouseIsPressed === true) %7B%0A    mouseFrame = true;%0A  %7D%0A%7D
 %0A
-
 keyPress
@@ -337,16 +337,40 @@
 = true;%0A
+    whichKey = keyCode;%0A
     if (
@@ -652,16 +652,37 @@
  false;%0A
+    whichKey = null;%0A
     if (
@@ -1099,9 +1099,10 @@
 x, ny%5D;%0A
-
 %7D
+%0A

Update keys.js