All I want to do is left click coordinates (or an image match if that is easier) on my second monitor without losing focus on my current window. The coordinates never change, and the window (Chrome) is always maximized on the second screen, so the place I want clicked is always visible and unobstructed, if that matters.
I'd normally show the code I'm trying to work with here, but as mentioned, I've tried everything and none of it has worked, so I don't actually have anything.
I do have a screenshot of window spy that I took when my mouse was over the element I want to click with ControlSend (It's a play/pause button - I can't use media keys for this element which is why I require this script). I also had the window (Chrome) highlighted:
If anyone could help with this, I'd be eternally grateful. I'm happy to answer any questions or provide any additional info if required.
Edit: I suppose I can share a script I'm currently using to send keystrokes to the same window. It works perfectly for keystrokes, but trying to repurpose it for ControlClicks instead of ControlSend has not been successful. Maybe this can help with getting something working:
Code: Select all
#IfWinNotActive, ahk_exe chrome.exe
!+NumpadRight::
; Gets the control ID of google chrome
ControlGet, controlID, Hwnd,,Chrome_RenderWidgetHostHWND1, Google Chrome
; Focuses on chrome without breaking focus on what you're doing
ControlFocus,,ahk_id %controlID%
ControlSend, Chrome_RenderWidgetHostHWND1, ^+{f}, Google Chrome
return
#IfWinNotActive