Well, my KeyListener works, but I think its a bit odd how it does work. I just checked, and whenever I press a key, the keyPressed() method is called once, waits a bit, and then it continuously gets called. I know this is normal.
But, I just checked, and as keyPressed is called continuously, keyReleased is called contiuously too. It looks something like this:
keyPressed
–wait for a second–
keyPressed
keyReleased
keyPressed
keyReleased
Is that normal that keyReleased is being called? Sometimes, it comes up with problems, like if I am travelling down right in my game, a keyPressed event is skipped, so it no longer travels in a diagonal direction, either down or right. However, this happens randomly.
It only lasts for a very little time, but its very noticeable. Any tips on how to fix this? I think it might have something to do with me being on Ubuntu, and I’m on OpenJDK.