Is this possible?

Get help with using AutoHotkey and its commands and hotkeys
RozRoyal
Posts: 24
Joined: 21 Nov 2017, 14:19

Is this possible?

23 Nov 2017, 20:10

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

Image

What code should I use to do this?

Thank you!
Osprey
Posts: 204
Joined: 18 Nov 2017, 05:50

Re: Is this possible?

23 Nov 2017, 20:21

Code: [Select all] [Download] GeSHi © Codebox Plus

~LButton::MouseGetPos, MouseX, MouseY

^LButton::Click %MouseX%, %MouseY%

With that, holding down Ctrl while left clicking will click in the same location that you last left clicked (while not holding Ctrl down).
RozRoyal
Posts: 24
Joined: 21 Nov 2017, 14:19

Re: Is this possible?

23 Nov 2017, 20:29

Thank you Osprey!
User avatar
jeeswg
Posts: 2981
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Is this possible?

23 Nov 2017, 20:51

- 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.

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

RozRoyal
Posts: 24
Joined: 21 Nov 2017, 14:19

Re: Is this possible?

24 Nov 2017, 10:14

Thank you Jeeswg! I will take a look : )
Last edited by RozRoyal on 24 Nov 2017, 10:37, edited 1 time in total.
RozRoyal
Posts: 24
Joined: 21 Nov 2017, 14:19

Re: Is this possible?

24 Nov 2017, 10:37

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?
vikcode

Re: Is this possible?

24 Nov 2017, 14:00

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?

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?
BoBo
Posts: 1603
Joined: 13 May 2014, 17:15

Re: Is this possible?

24 Nov 2017, 14:39

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/
Osprey
Posts: 204
Joined: 18 Nov 2017, 05:50

Re: Is this possible?

24 Nov 2017, 19:26

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:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus


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.
Last edited by Osprey on 25 Nov 2017, 13:22, edited 9 times in total.
RozRoyal
Posts: 24
Joined: 21 Nov 2017, 14:19

Re: Is this possible?

25 Nov 2017, 00:46

OMG! Osprey you are a legend!!! THANK YOU!!!

I would give you a tenner if I could!!!

Thanks BoBo and Vikcode for the tips!

Return to “Ask For Help”

Who is online

Users browsing this forum: john_c, TAC109 and 44 guests