I am doing a college project and need to use Java and Lanterna to develop a game.
I have the game almost completed but need to fix this problem, where if I press a key for too long, after releasing it the game still thinks that I am pressing it, stopping only after a while.
The key press is read using the .pollInput() Lanterna method, and only made once per frame. The game has a set frame rate.
I tried changing the frame rate in order to see if that affected anything, but it didn't seem to have a direct influence. Because I am only checking the input once per frame and this problem still occurs, I though that the only way this can happen is if the Lanterna saves in the Input pool, the key presses in a constant speed, not affected by the calling of the .pollInput method.
Considering this, is there any way for me to fix this problem?
I am guessing that changing the frame rate did not affect anything since it's already too slow for the speed in which Lanterna adds inputs to the pool. I had a much simpler version of the game, and when the frame rate was high the problem did not occur.
I appreciate all the feedback, thanks for the support!