Fix keyboard input sometimes freezing in menu