I was wondering if instead of doing this
protected override void OnKeyDown(KeyEventArgs e)
{
if (e.KeyCode == Keys.A)
Console.WriteLine("The A key is down.");
}
I could set up a bool method and do this:
if(KeyDown(Keys.A))
// do whatever here
I've been sitting here for ages trying to figure out how to do it. But I just can't wrap my head around it.
In case you were wondering, my plan is to call the bool inside a different method, to check for input.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…