I'm making a speed game in VB.Net (Console Application) and users have a certain time to press a certain key. So how can I give the Console.ReadKey function a timeout without just waiting until a key was pressed?
Asked
Active
Viewed 173 times
1
-
2See http://stackoverflow.com/questions/57615/how-to-add-a-timeout-to-console-readline – tzaman May 15 '10 at 13:39
-
Thank You! Added answer. – lesderid May 15 '10 at 14:40
1 Answers
1
You should use a timer. When the user selects the correct key you can disable it. If the user is to then choose a different key you can just reset it.
NoAlias
- 9,138
- 2
- 28
- 45