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

Possibly Related Threads…
Thread Author Replies Views Last Post
  Setting mouse to ignore outside of _NewImage PhilOfPerth 11 712 12-18-2025, 07:20 PM
Last Post: Pete
  Do Loop, Sleep and Mouse Button Dimster 5 584 09-06-2025, 12:57 PM
Last Post: Dimster
  Stopping repeated mouse-key press PhilOfPerth 8 852 09-02-2025, 11:28 PM
Last Post: Pete
  Best & Optimized way to check for intersection of squares aadityap0901 8 978 07-27-2025, 08:32 PM
Last Post: Unseen Machine
  Another Mouse Issue? NakedApe 17 2,817 05-02-2024, 03:16 AM
Last Post: NakedApe

Forum Jump:


Users browsing this thread: 1 Guest(s)