I'm building a simple "breakout" style video-game, and I want keyboard
control of the paddle.
What I need is for an event handler to respond whenever a key is pressed,
regardless of what the focus is set to. So far, the best I've been able to
accomplish is to create a button and have that button handle the KeyDown
event. I've tried using KeyDown on the form, but it simply doesn't work.
I did a search on this, and found on site that suggested overriding the
system "OnKeyDown" event handlers - but I haven't gotten this to work,
either. It could be because I'm putting it in the wrong place, or perhaps
it's just not the way to do it.
I'm using Visual C# Studio - the new Beta edition, if that makes a
difference. Any suggestions would be greatly appreciated.
control of the paddle.
What I need is for an event handler to respond whenever a key is pressed,
regardless of what the focus is set to. So far, the best I've been able to
accomplish is to create a button and have that button handle the KeyDown
event. I've tried using KeyDown on the form, but it simply doesn't work.
I did a search on this, and found on site that suggested overriding the
system "OnKeyDown" event handlers - but I haven't gotten this to work,
either. It could be because I'm putting it in the wrong place, or perhaps
it's just not the way to do it.
I'm using Visual C# Studio - the new Beta edition, if that makes a
difference. Any suggestions would be greatly appreciated.
Comment