bool InputPending () { // check if we've got pending input we can read immediately return readpos < writepos || stdin.DataAvailable (); }