Home Ask Login Register

Developers Planet

Your answer is one click away!

madkaratemans February 2016

How to Disable the Ability to Type in a Console Application?

I'm currently attempting to make a snake clone in VB2015 using the console template. I'm wondering if I can disable the ability to type so I can finish it. Thank you.


cramopy February 2016

Taken from Hans Passant's answer here:

while (!Done)
    while (Console.KeyAvailable) Console.ReadKey(true);
    ConsoleKeyInfo key = Console.ReadKey(true);
    // etc..

Post Status

Asked in February 2016
Viewed 2,152 times
Voted 8
Answered 1 times


Leave an answer

Quote of the day: live life