Automatic switch cursor for input and ESC key for exit program.