This App is No Longer Maintained. Visit the Replacement at StrokesPlus.net

StrokesPlus Forum
                       
StrokesPlus Forum
Home | Profile | Active Topics
Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General Discussion
 General Discussion
 [Solved!]How to return to the last mouse location?
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

AxJ

28 Posts

Posted - 01/29/2019 :  01:48:01  Show Profile
I want to use "acGetMouseLocationX/y" to achieve this but I don't know how to tell the S+ to go to the mouse location I just acquired.

Any instruction? Thanks!

EDIT: Problem solved!

Edited by - AxJ on 01/30/2019 17:17:44

Rob

USA
2615 Posts

Posted - 01/29/2019 :  06:29:17  Show Profile  Visit Rob's Homepage
acMouseMove(x, y) will move the mouse to the x,y coordinates.
Go to Top of Page

AxJ

28 Posts

Posted - 01/29/2019 :  06:39:34  Show Profile
quote:
Originally posted by Rob

acMouseMove(x, y) will move the mouse to the x,y coordinates.



The mouse cursor finally moves to (0, 0).
Did I do something wrong?
My actions down below:
-------------------------
acGetMouseLocationX()
acGetMouseLocationY()
acMouseClick(1540, 210, 2, 1, 1)
acMouseMove(x, y)

Edited by - AxJ on 01/29/2019 06:44:43
Go to Top of Page

Rob

USA
2615 Posts

Posted - 01/29/2019 :  06:50:05  Show Profile  Visit Rob's Homepage
It looks like you just want to move the mouse back to where the gesture ended (where the mouse was before moving to click)?

--Prevent accidental mouse movements
acConsumePhysicalInput(1)
--Move the mouse to where you want to click
--Sometimes a program wants to see the mouse is there first
acMouseMove(1540,210)
--Wait a moment for the mouse to settle at the new location
acDelay(10) 
--Click the mouse button. The last two values means it will 
--click down and up, so you don't need to call it twice
acMouseClick(1540, 210, 2, 1, 1) 
--Move the mouse to where the gesture ended
acMouseMove(gex,gey)
--Allow mouse and keyboard input again
acConsumePhysicalInput(0)


But if you specifically want to get the mouse location, and not where the gesture ended:

--Prevent accidental mouse movements
acConsumePhysicalInput(1)
--Get the current mouse coordinates and store them
local mousex = acGetMouseLocationX()
local mousey = acGetMouseLocationY()
--Move the mouse to where you want to click
--Sometimes a program wants to see the mouse is there first
acMouseMove(1540,210)
--Wait a moment for the mouse to settle at the new location
acDelay(10) 
--Click the mouse button. The last two values means it will 
--click down and up, so you don't need to call it twice
acMouseClick(1540, 210, 2, 1, 1) 
--Move the mouse to where the gesture ended
acMouseMove(mousex,mousey)
--Allow mouse and keyboard input again
acConsumePhysicalInput(0)


Go to Top of Page

AxJ

28 Posts

Posted - 01/29/2019 :  07:16:16  Show Profile
quote:
Originally posted by Rob

It looks like you just want to move the mouse back to where the gesture ended (where the mouse was before moving to click)?
...

Yes! You nailed it!
I just want the mouse cursor going back to the location(end of gesture) just before it moves to the new one after completing some actions.
And the result is perfect & satisfying!!!

quote:
But if you specifically want to get the mouse location, and not where the gesture ended:
...

Oh, so, that's how to declare the variables! Thank you, I got it!

Another mission accomplished!! What a day!!

Edited by - AxJ on 02/20/2019 05:35:28
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
StrokesPlus Forum © 2011-2018 Rob Yapchanyk Go To Top Of Page
Snitz Forums 2000