so right now I'm using a function that will set to true if one key is pressed, the other is pressed, regardless of whether the first one is pressed.
function doc_keyUp1(e) { if (e.keyCode == 37){ lPunch = true } } function doc_keyUp2(e) { if (e.keyCode == 39){ rPunch = true } } document.addEventListener('keyup', doc_keyUp1, false) document.addEventListener('keyup', doc_keyUp2, false)
The fact is that I want him to make sure that if the second key is pressed, the first one should still be down, so that someone could not just quickly press one and then the other, and make it seem like they are pressed together to friend.
Any ideas?
source share