Full error image
I’m trying to use the keyboard class.
Here is my code
using System;
using System.Windows; // shows this is unnecessary
namespace HelloWorld
{
public class Map
{
public string[][] layer { get; set; }
public int[][] collision { get; set; }
}
class Program
{
static void Main(string[] args)
{
while (true)
{
Console.WriteLine(System.Windows.Input.Keyboard.IsKeyDown(ConsoleKey.Spacebar));
}
}
}
}
Screenshot of error
What do I do?
I tried to add using Windows.Input
but it’s just showing a IDE0005 warning.
I want to use Keyboard.IsKeyDown
for my game but yeah
4
Try this
Add PresentationCore.dll assembly as a reference.
Add WindowsBase.dll assembly as a reference.
New contributor
WangDaChui is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
3