Reputation: 2445
I am creating a simple ball and paddle program in C# and using mouse clicks to move the paddle. In order to register the mouse clicks, I have this
private void Form1_MouseClick(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Right)
{
paddle.movePaddleRight();
this.Invalidate();
}
if (e.Button == MouseButtons.Left)
{
paddle.movePaddleLeft();
this.Invalidate();
}
}
The problem is that it doesn't register a rapid succession of clicks. After one click, it takes about half a second to register the next click (all clicks inbetween are lost). Is there a way for me to make the paddle move according to every click and register every click?
Upvotes: 5
Views: 1156
Reputation: 942438
Clicking fast produces the MouseDoubleClick event. Use the MouseDown event instead.
Upvotes: 8