Search code examples
.netvb.netmousedown

Why does MouseDown event have a 6 second delay in vb.net?


Current working code with mouse:

Private Sub FilterMouseDown(sender As System.Object, e As System.Windows.Forms.MouseEventArgs) Handles btnFilterUp.MouseDown
    'Do something
End Sub

I would like to work with a touch screen now, but the touch driver doesn't allow a finger touching and holding the button to register as a MouseDown until 6 seconds later. This is too long of a delay for my application and I can't figure out how to disable this touch issue.

As a work around, I would like to have the ability to register a touch event in the vb code. I was thinking it would look something like this:

Private Sub FilterMouseDown(sender As System.Object, e As System.Windows.Forms.TouchEventArgs) Handles btnFilterUp.TouchDown
    'Do something
End Sub

Can this be done with Visual Studio 2013 Express? If so, can you point me in the right direction? Do I need to add a touch library or something?


Solution

  • I think I finally stumbled on a fix. It's not pretty, but I think it will do the job: 1. Open up the Control Panel and open up the Pen and Touch Settings. 2. On the Touch tab, click on the Press and hold touch action and then click on Settings… 3. Check the “Enable press and hold for right-clicking” box, change the Speed all the way to Short, and change the Duration all the way to Short. 4. Uncheck the “Enable press and hold for right-clicking” box, and click OK. Then click Apply and OK.

    After this change, the delay should be 1 second instead of 6.