Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Repeating mouse check
#1
I need to check my mouse-click positions several times, but seem to be stuck with its first location each time.
This is a simplified version of what I'm using; What am I doing wrong? (pardon the GoTo's)

Code: (Select All)
GetFirst: '                                            to find first mouse position
Locate 20, 30: Print "Choose first location"
m% = _MouseInput '                                     prepare mouse
If _MouseButton(1) Then '                              get left-mouse
    MX = _MouseX: MY = _MouseY '                       get horiz and vert position
    Print MX, MY
    GoTo GetSecond '                                   and go to GetSecond
Else GoTo GetFirst '                                   if left-mouse not pressed go back and try again
End If


GetSecond: '                                           to find second mouse position
While _MouseButton(1): Wend '                          wait for left-mouse to restore
Print "Choose second location"
'm% = _MouseInput '                                     prepare mouse (is this needed again?)
If _MouseButton(1) Then '                              get left-mouse again
    MX = _MouseX: MY = _MouseY '                       get new horiz and vert position
    Print MX, MY
    Sleep
Else GoTo GetSecond '                                  if left-mouse not pressed go back and try again
End If
Sleep
Of all the places on Earth, and all the planets in the Universe, I'd rather live here (Perth, Western Australia.) Big Grin
Please visit my Website at: http://oldendayskids.blogspot.com/
Reply


Messages In This Thread
Repeating mouse check - by PhilOfPerth - 07-24-2024, 03:50 AM
RE: Repeating mouse check - by DSMan195276 - 07-24-2024, 05:03 AM
RE: Repeating mouse check - by PhilOfPerth - 07-24-2024, 05:47 AM
RE: Repeating mouse check - by Pete - 07-24-2024, 09:08 PM
RE: Repeating mouse check - by PhilOfPerth - 07-24-2024, 11:26 PM



Users browsing this thread: 1 Guest(s)