StrokesPlus Forum
                       
StrokesPlus Forum
Home | Profile | Register | Active Topics
Members | Search | FAQ
 All Forums
 General Discussion
 General Discussion
 [Solved!]How to return to the last mouse location?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
AxJ Posted - 01/29/2019 : 01:48:01
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!
4   L A T E S T    R E P L I E S    (Newest First)
AxJ Posted - 01/29/2019 : 07:16:16
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!!
Rob Posted - 01/29/2019 : 06:50:05
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)


AxJ Posted - 01/29/2019 : 06:39:34
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)
Rob Posted - 01/29/2019 : 06:29:17
acMouseMove(x, y) will move the mouse to the x,y coordinates.

StrokesPlus Forum © 2011-2018 Rob Yapchanyk Go To Top Of Page
Snitz Forums 2000