I'm trying to throw together a game to go on the
website of my IT Director's band, The Bitters.
I'm doing the game in C# using GDI+ for now. May go DirectX later, but GDI is just so easy.
At one point, I needed to capture the arrow keys being pressed. KeyPress doesn't cut it. When KeyPress fires, you don't get access to control keys. But I found out that you can override ProcessDialogKeys to get it done.
protected override bool ProcessDialogKey(Keys keyData)
{
switch(keyData)
{
case Keys.Down:
{
break; } case Keys.Up: { break; } case Keys.Left: { break; } case Keys.Right: { break; } case Keys.Space: { break; } } return base.ProcessDialogKey (keyData);
}
This will also give you access to the letter keys and stuff, but you will see Keys.A, not whether or not it was capital "A".
I'll link the game when it's done. But if you are going to be in Ocala, FL this week, check out The Bitters at Tin Cups Tavern on Thursday evening. Or stop by their site and pick up a
CD. They're kind of a punk/pop group, influences ranging from the Ramones and Sex Pistols up to Green Day and Blink 182. Good stuff.