You should call the keyHandler.poll() method every frame (ideally before updating the player and other things to make it as responsive as possible), e.g.1 2 3 4 5 6 7 8 9 10 11 final long OPTIMAL_TIME = 1000000000 / TARGET_FPS; long lastFpsTime = 0; int fps = 0; while (loopCondition) {