Hi!
Is it possible to click in an area where I last clicked?
For example, when I click in the blue area and move my mouse around, when I press a key I want to click in the same place where I first clicked
What code should I use to do this?
Thank you!
Is this possible?
Re: Is this possible?
Code: Select all
~LButton::MouseGetPos, MouseX, MouseY
^LButton::Click %MouseX%, %MouseY%
Re: Is this possible?
Thank you Osprey!
Re: Is this possible?
- That's a great script, cheers. I've done a little mod, that returns the mouse to where it was.
- Btw I believe that the CoordMode for the mouse is constantly reset to the default, so if the default was not screen, then you have to set it to screen in each hotkey subroutine.
- Btw I believe that the CoordMode for the mouse is constantly reset to the default, so if the default was not screen, then you have to set it to screen in each hotkey subroutine.
Code: Select all
~LButton::
CoordMode, Mouse, Screen
MouseGetPos, vCurX, vCurY
return
^LButton::
SendInput, {Ctrl Up}{LButton Up}
CoordMode, Mouse, Screen
MouseGetPos, vCurX2, vCurY2
Click, % vCurX ", " vCurY
MouseMove, % vCurX2, % vCurY2
return
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Re: Is this possible?
Thank you Jeeswg! I will take a look : )
Last edited by RozRoyal on 24 Nov 2017, 10:37, edited 1 time in total.
Re: Is this possible?
What if:
I click on the youtube video and then
I leave the video and interact with something ells by clicking
and when I come back to the youtube video I want to click in the same place I last clicked within that video?
How about this approach? I that possible?
I click on the youtube video and then
I leave the video and interact with something ells by clicking
and when I come back to the youtube video I want to click in the same place I last clicked within that video?
How about this approach? I that possible?
Re: Is this possible?
you can make the entire thing only work if you are in the chrome or in the firefox, so maybe that an idea for you?RozRoyal wrote:What if:
I click on the youtube video and then
I leave the video and interact with something ells by clicking
and when I come back to the youtube video I want to click in the same place I last clicked within that video?
How about this approach? I that possible?
Re: Is this possible?
You can also restart/loop a video from a specific position using YouTube's command line/URL "start"-parameter (the value is counted in seconds)
[your original url]
[... starting at minute 1.30 = 90sec] (uses ...&start=90)
[... starting at minute 1.50 = 110sec] (uses ...&t=1m50s)
Another option if you're interested in start+end time: http://www.youtubestartend.com/
[your original url]
[... starting at minute 1.30 = 90sec] (uses ...&start=90)
[... starting at minute 1.50 = 110sec] (uses ...&t=1m50s)
Another option if you're interested in start+end time: http://www.youtubestartend.com/
Re: Is this possible?
The following will save the position of your last click on every window or tab, allowing you to re-click there, no matter how many other windows or tabs you've visited since:
Two caveats:
* It relies on unique window titles, so, for example, if you have two tabs open with the title of "New Tab", it'll treat them as the same window.
* If you plan to use it with tabs in a browser, you should use the standard Ctrl+Tab and Ctrl+Shift+Tab shortcuts to switch tabs, since clicking on a tab to change to it counts as a click on that first tab.
If you want a little more control (and to avoid the second issue), you might consider changing "~LButton" above to, for example, "+LButton", so that you need to Shift-click to save coordinates. That would allow you to click around the same page without erasing the coordinates that you saved. In that case, think of it like a clipboard for mouse coordinates, but, instead of Ctrl+C and Ctrl+V, you're doing Shift+click and Ctrl+click. In fact, it might may more sense to do Ctrl+click (^LButton::) to store the click and Alt+click (!LButton::) to re-click, since Ctrl and Alt are left and right of one another, like C and V are.
Code: Select all
Array := Object() ; Create an array that will be used for saving mouse click coordinates for each window
CoordMode, Mouse, Client ; Limit mouse coordinate saving to only the client area of each window (i.e. the area excluding the title bar and borders)
~LButton::
WinGetActiveTitle, CurrentWindow ; Get the title of the currently active window
MouseGetPos, MouseX, MouseY ; Get the current mouse coordinates
Array[CurrentWindow, "X"] := MouseX ; Save the mouse's X coordinates in the array for the current active window title
Array[CurrentWindow, "Y"] := MouseY ; Save the mouse's Y coordinates in the array for the current active window title
return
^LButton::
WinGetActiveTitle, CurrentWindow ; Get the title of the currently active window
MouseX := Array[CurrentWindow, "X"] ; Retrieve the mouse's X coordinates from the array for the current active window title
MouseY := Array[CurrentWindow, "Y"] ; Retrieve the mouse's Y coordinates from the array for the current active window title
Click %MouseX%, %MouseY% ; Click on those mouse coordinates
return
* It relies on unique window titles, so, for example, if you have two tabs open with the title of "New Tab", it'll treat them as the same window.
* If you plan to use it with tabs in a browser, you should use the standard Ctrl+Tab and Ctrl+Shift+Tab shortcuts to switch tabs, since clicking on a tab to change to it counts as a click on that first tab.
If you want a little more control (and to avoid the second issue), you might consider changing "~LButton" above to, for example, "+LButton", so that you need to Shift-click to save coordinates. That would allow you to click around the same page without erasing the coordinates that you saved. In that case, think of it like a clipboard for mouse coordinates, but, instead of Ctrl+C and Ctrl+V, you're doing Shift+click and Ctrl+click. In fact, it might may more sense to do Ctrl+click (^LButton::) to store the click and Alt+click (!LButton::) to re-click, since Ctrl and Alt are left and right of one another, like C and V are.
Last edited by Osprey on 25 Nov 2017, 13:22, edited 9 times in total.
Re: Is this possible?
OMG! Osprey you are a legend!!! THANK YOU!!!
I would give you a tenner if I could!!!
Thanks BoBo and Vikcode for the tips!
I would give you a tenner if I could!!!
Thanks BoBo and Vikcode for the tips!
Who is online
Users browsing this forum: jameswrightesq, wpulford and 426 guests