console class

  • Thread starter Thread starter DaveP
  • Start date Start date
D

DaveP

is there a method of console class where i can
be in a loop and just read keys pressed
example
while true
{
somekey=somemethod() // does not wait for enter key just continues
if (somekey==somevalue)
{
break;
}
}
 
DaveP said:
is there a method of console class where i can
be in a loop and just read keys pressed

No, but you can check the Console.KeyAvailable property to tell you
whether ReadKey() will return immediately.

Pete
 
Back
Top