add proc for stdin event handling.

also corrected type.