Skip to content Skip to sidebar Skip to footer

Html5 Arrow Keys Not Working Correctly

Hello everyone, I'm currently having issues making the arrow keys working correctly while pressing [space] key. Everything is working whle holding [space] key and one of the arrow

Solution 1:

Odds are this is nothing to do with your code. Many keyboards, to save cost, are not capable of supporting every combination of 3 or more keys at once, and are specifically wired to support combinations that are in common use (such as Ctrl+Alt+Del). The phenomenon is known as "ghosting".

See this page from Microsoft for an expanded explanation.

Solution 2:

I had the same issue (I found the issue but not the solution) the key codes for up and left follow each other. so do down and right. The fact that the key codes follow each other seems to be the issue. if you set A to move player UP and B to move player DOWN, then press A+B+spaceBar the same issue occurs. but when the key codes are different (e.g. wasd) the three button press works. using WASD might seem like a good idea but wait until someone using a French keyboard plays your game. Any way I wrote this hoping that someone would find a work around.

Post a Comment for "Html5 Arrow Keys Not Working Correctly"