I am trying to make a small game in a console application in Visual Studio. I want to discover when I released the key. Because now that I release the key, it remains βtrueβ until I hit any other key.
Here is my code
while (true) { keyInfo = Console.ReadKey(); if(keyInfo.Key == ConsoleKey.RightArrow) { rightPressed = true; } else { rightPressed = false; } }
Does anyone have a solution?
source share