Pure standard input, or do you know it is always the keyboard?

(The first typically for cgi's, the second for console programs)

If the latter, have a look at the "keyboard" unit that is used by the textmode IDE. The textmode IDE needs such functionality too, since it is eventdriven.