Direction array to support multiple keydowns in 4-directional movement
If you don't need to support IE8 and under, you could cut out those for-loops by using indexOf().

// Only add the direction if it doesn't exist yet
Keys.prototype.add = function (dir) {
    if (!~this.keys.indexOf(dir)) {
        // you could also do this.keys.indexOf(dir) == -1
        this.keys[this.keys.length] = dir;
    }
};

// Find the index of the first occurrence and splice the array there without it
Keys.prototype.remove = function (dir) {
    // you could also save this in a variable to use the second time
    if (~this.keys.indexOf(dir)) {
        this.keys.splice(this.keys.indexOf(dir), 1);
    }
};


Instead of this.keys[this.keys.length] = dir;, you could just push():

this.keys.push(dir);


Your check in Keys.prototype.getLast is redundant. It'll either return an item from the array, or nothing (undefined). A nonexistant array index also returns undefined, so you could just cut it out:

Keys.prototype.getLast = function () {
    return this.keys[this.keys.length - 1];
};


If you need to support oldIE, you could at least optimize Keys.prototype.remove by adding a return statement after removing the item:

Keys.prototype.remove = function (dir) {
    for (var i = 0; i &lt; this.keys.length; i++) {
        if (this.keys[i] == dir) {
            this.keys.splice(i, 1);
            return;
        }
    }
};