This bit of code generates that error in Chrome's JavaScript console & I'm not sure why. After Googling around for people with similar issues, I haven't found any D:
The error message suggests that the issue is with the event.which()
but I don't see how I'm using it any differently from expected, other people with similar don't seem to have had problem with it.
$(document).keypress(function(event) {
switch (event.which()) {
case 38 : keyNorthPressed = true;
break;
case 39 : keyEastPressed = true;
break;
case 40 : keySouthPressed = true;
break;
case 41 : keyWestPressed = true;
break;
}
});
Thanks in advance.