Q:

Left/Right Mouse Click Function VB.NET

I'm trying to make my own auto-clicker (settable to left or right, depending on the radio button selection) and I can't seem to make the mouse click. In order to be able to set the delay wished for the auto-clicker, I've put it within the Timer1 (one for left click, one for right click). My questions are:
a) How can I make the mouse click when a certain key is pressed (e.g, F6).
b) How can I make it have the delay of Timer1/Timer2 for each click.
For the record, I wish for this auto-clicker to work EVERYWHERE, not just within the form.

A:

You can use user32.dll lib.
Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Integer, ByVal dx As Integer, ByVal dy As Integer, ByVal cButtons As Integer, ByVal dwExtraInfo As Integer)

&H2 means left mouse button down.
&H4 means left mouse button up.
mouse_event(&H2, 0, 0, 0, 0)
mouse_event(&H4, 0, 0, 0, 0)

