Question

My JS mini-game don't work correctly. It only records the first two key pressed.

You can see the problem in this jsFiddle

My code is really big, I am not sure what to put here, but I think the problem is here:

document.onkeypress=function(e){
    var charCode;

    e=e||window.event;

    charCode=typeof e.which=="number"?e.which:e.keyCode;

    if((charCode>=102&&charCode<=104)||charCode==106){
        getKey(charCode==106?4:charCode-101);//F-G-H-J=1-2-3-4
    }
    return false;
};

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top