I would do this by creating separate a thread which calls normal blocking IO functions and pass it a callback function which it would call when it got input. Are you sure you need to do what you said you want to do?
As for outputting information at the same time, what would happen if the user was in the middle of typing some input and you printed something?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…