Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

How to get keystroke from form without delay

$
0
0

I am creating a small game that requires keystrokes. As you may know a form gets keystrokes like a textbox does. When you hold down a key it pauses for a while before continuing. Is there a way I can make my form so that it does not the delay. As of right now I am using

this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Form1_KeyDown);

and

public void Form1_KeyDown(object sender, KeyEventArgs e)
{
switch (e.KeyDown)
{
case Keys.Left:
keystroke = "left";
break;
}
}
Thanks


Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>