improve console keyboard input handling