in reply to input problem

I'm not clear on what you are looking for. Are you saying that input may come from the keyboard or may come from a file? Or you want to test if there is data ready to read from the keyboard?