Thanks for the advice, changing the mouse speed isnt quite what i want, i'd like the speed to be same, just happen x milliseconds later.
Anyway, I wrote some code around the idea of just hiding the mouse pointer (altho in the below code it's commented out), but doesn't seem to
want to work correctly. I'll paste the code here..just open up a big form, and add a radio button with no text (acting as a temp 'fake'
mouse cursor):
Public Class Form1
Dim t As New Timer
Dim iX(0) As Integer
Dim iY(0) As Integer
Dim i1 As Integer = 0
Dim i2 As Integer = 0
Dim tmEvent1(0) As DateTime
Dim tmEventNow As DateTime
Dim tmSpan As TimeSpan
Dim tmEventMisc As DateTime
Private Sub Form1_Click(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles Me.Click
Me.Close()
End Sub
Private Sub Form1_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles Me.Load
t.Interval = 1
AddHandler t.Tick, AddressOf Me.MoveFakeMouse
t.Start()
End Sub
Private Sub Form1_MouseEnter(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles Me.MouseEnter
'Cursor.Hide()
End Sub
Private Sub Form1_MouseLeave(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles Me.MouseLeave
'Cursor.Show()
End Sub
Private Sub Form1_MouseMove(ByVal sender As Object, _
ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove
ReDim iX(i1)
ReDim iY(i1)
ReDim tmEvent1(i1)
iX(i1) = e.X
iY(i1) = e.Y
tmEvent1(i1) = Now
i1 += 1
End Sub
Private Sub MoveFakeMouse()
Me.Text = CStr(i1) & " " & CStr(i2) & " - X:" & CStr(iX(i2)) & _
" Y:" & CStr(iY(i2))
If i2 >= (tmEvent1.Count - 1) Then Exit Sub
tmEventNow = Now
tmEventMisc = tmEvent1(i2)
tmSpan = tmEventNow.Subtract(tmEventMisc)
If tmSpan.TotalMilliseconds > 20 Then
RadioButton1.Top = iY(i2)
RadioButton1.Left = iX(i2)
i2 += 1
End If
End Sub
End Class
The idea is, Form1_MouseMove adds the current mouse coords to an array (iX, iY), and also the current time to a secondary array (tmEvent).
And the timer, every milisecond, triggers MoveFakeMouse(). This sub then checks the time on the tmEvent array with current time and if its
20ms difference, moves the radiobutton using the coords from the associated iX & iY arrays. Then moves on to next array and just keeps doing
that...
But the radiobutton doesn't seem to move, or if it does, it will only move after the mouse has stopped moving and the MoveFakeMouse has
'caught up'. I have a me.text line in there to show it catching up and how the x/y coords dont show up til then.... Anyway, any ideas on why
it's not working, or if i'm completely doing it wrong, another way of doing it... Just looking for a way to delay mouse movement, or have a
fake cursor do exact same movements, just a few moments later....