Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Faster MouseClick Response?

Tags:

c#

winforms

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?

like image 354
krikara Avatar asked Mar 10 '13 23:03

krikara


People also ask

What is the fastest mouse response time?

Actuation is achieved at the speed of light, generating the fastest response time in gaming at 0.2 milliseconds — 3 times faster than traditional mechanical switches.


1 Answers

Clicking fast produces the MouseDoubleClick event. Use the MouseDown event instead.

like image 161
Hans Passant Avatar answered Sep 27 '22 21:09

Hans Passant