Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Mouse click to non active window


  • Please log in to reply
12 replies to this topic
rotro
  • Members
  • 18 posts
  • Last active: Feb 14 2012 02:13 AM
  • Joined: 21 Mar 2011
Is there a command to send mouse click coordinates to specific non active windows similar to ControlSend for the keyboard?

Thanks

OnlyHuman
  • Members
  • 284 posts
  • Last active: Aug 22 2015 10:11 PM
  • Joined: 18 Feb 2011
This works for me, but whatever your clicking cannot move with this command, MouseClick. Try this...
CoordMode, mouse, screen ; does NOT use active window coords

^1:: ; Ctrl + 1 hotkey
MouseClick, left, 682, 57 ; replace coords as needed

Docs
I use AHK 1.1.20.03 32-bit ~~ Windows 10 (64 bit) ~~ Firefox


rotro
  • Members
  • 18 posts
  • Last active: Feb 14 2012 02:13 AM
  • Joined: 21 Mar 2011
THANKS! Going to try it :)

OnlyHuman
  • Members
  • 284 posts
  • Last active: Aug 22 2015 10:11 PM
  • Joined: 18 Feb 2011
Your welcome! If it doesn't work i know another possibility (ATM it's untested).

Docs
I use AHK 1.1.20.03 32-bit ~~ Windows 10 (64 bit) ~~ Firefox


Honest Abe
  • Members
  • 310 posts
  • Last active: Jan 08 2015 08:56 PM
  • Joined: 07 Jan 2011
ControlClick

x::ControlClick, x102 y156, AutoHotkey_L Help

Win7 (x64)
Look up commands faster by using the AutoHotkey Help File's index.
Start→AllPrograms→AutoHotkey→AutoHotkey Help File


Grendahl
  • Members
  • 416 posts
  • Last active: Jul 07 2014 08:01 PM
  • Joined: 10 Aug 2009
I agree with Honest Abe... ControlClick is the way to go.
Always have your scripts when you need them with Dropbox.
Sign up for free! http://db.tt/9Hrieqj

rotro
  • Members
  • 18 posts
  • Last active: Feb 14 2012 02:13 AM
  • Joined: 21 Mar 2011
I have messed with this for some time this morning and have determined that ControlClick is what I was looking for, however it appears to only send a click to an inactive wow window where my mouse actually is on the screen. And even then, it unreliably works. And then if it does work, randomly tosses my mouse cursor somewhere.

This is the test script I could get to work most often, but not always.

~1::
{
 MouseMove, 750, 750, 4
 ControlSend, , {numpad8 down}{numpad8 up}, World of Warcraft
 ControlClick,,World of Warcraft
}
return


Honest Abe
  • Members
  • 310 posts
  • Last active: Jan 08 2015 08:56 PM
  • Joined: 07 Jan 2011

I have messed with this for some time this morning and have determined that ControlClick is what I was looking for, however it appears to only send a click to an inactive wow window where my mouse actually is on the screen. And even then, it unreliably works. And then if it does work, randomly tosses my mouse cursor somewhere.

This is the test script I could get to work most often, but not always.

~1::
ControlSend,, {numpad8 down}{numpad8 up}, World of Warcraft
ControlClick, [color=red]x750 y750[/color], World of Warcraft
return


Did you try entering the coordinates as indicated in red?

Win7 (x64)
Look up commands faster by using the AutoHotkey Help File's index.
Start→AllPrograms→AutoHotkey→AutoHotkey Help File


rotro
  • Members
  • 18 posts
  • Last active: Feb 14 2012 02:13 AM
  • Joined: 21 Mar 2011
Yes. Just to make sure I typed it right, copied what you replied and tried it. If I have the world of warcraft window in focus, it fires spell at my actual mouse coords and not what was specified.

If I instead go to this forum and hit 1, all it does back on the warcraft window is ControlSend,, {numpad8 down}{numpad8 up}, World of Warcraft. It seems as though its due to the mouse being off the window that it doesn't click at all.

If I go ahead and select the spell manually to get the targeting icon, leave it somewhere on the wow screen, alt-tab back to this page and hit 1, the spell fires at the coordinates of my actual mouse cursor and not what was specified.

Honest Abe
  • Members
  • 310 posts
  • Last active: Jan 08 2015 08:56 PM
  • Joined: 07 Jan 2011

Read about controlclick's options:
<!-- m -->http://l.autohotkey....ontrolClick.htm<!-- m -->

and maybe try something like

~1::
SetControlDelay -1
ControlSend,, {numpad8 down}{numpad8 up}, World of Warcraft
ControlClick, YourWOWcontrol, World of Warcraft,,,, NA X750 Y750
return

I'd try with and without the NA.

Win7 (x64)
Look up commands faster by using the AutoHotkey Help File's index.
Start→AllPrograms→AutoHotkey→AutoHotkey Help File


OnlyHuman
  • Members
  • 284 posts
  • Last active: Aug 22 2015 10:11 PM
  • Joined: 18 Feb 2011
Some things to try that "should" help reliability would be...
CoordMode, ToolTip|Pixel|Mouse|Caret|Menu [, Screen|Relative]
DetectHiddenWindows, On
DetectHiddenText, On

If you think the script is NOT finding your target window (WOW) then try...
SetTitleMatchMode

MatchMode


One of the following digits or the word RegEx:

1: A window's title must start with the specified WinTitle to be a match.
2: A window's title can contain WinTitle anywhere inside it to be a match.
3: A window's title must exactly match WinTitle to be a match.

RegEx (v1.0.45+): Changes WinTitle, WinText, ExcludeTitle, and ExcludeText to be regular expressions. Do not enclose such expressions in quotes when using them with commands. For example: WinActivate Untitled.*Notepad. RegEx also applies to ahk_group and ahk_class; for example, ahk_class IEFrame searches for any window whose class name contains IEFrame anywhere (this is because by default, regular expressions find a match anywhere in the target string). Note: For WinText, each text element (i.e. each control's text) is matched against the RegEx separately. Therefore, it is not possible to have a match span more than one text element.

The modes above also affect ExcludeTitle in the same way as WinTitle. For example, mode 3 requires that a window's title exactly match ExcludeTitle for that window to be excluded.

Hope this Helps!

Docs
I use AHK 1.1.20.03 32-bit ~~ Windows 10 (64 bit) ~~ Firefox


rotro
  • Members
  • 18 posts
  • Last active: Feb 14 2012 02:13 AM
  • Joined: 21 Mar 2011
Just providing some more information for others curious. Spent time experimenting and it appears the point icon within the world of warcraft game is where the spell fires and the icon is not activated by the controlclick command. It is activated by the mouse move. Also, the icon has to be in the gaming field when switching screens.

Over and over I tried all kinds of combinations of your suggestions and mouse move on the active window is the only method I could get to work on the background window, and only reliably IF the icon was already present and within the gaming field when I switched screens. Then it worked every time.

But, I am done fooling with it. My 5 dudes are doing fine without aoe spells. Thanks for the help. I'll wait til someone else figures it out.

rotro
  • Members
  • 18 posts
  • Last active: Feb 14 2012 02:13 AM
  • Joined: 21 Mar 2011
I had to update this. Mouse move and control click works repeatably. I had to get this to work for Healing Rain.

I tried some offsets and things, but depending on the angle of the active window, it was so complicated I could not buy enough beers to even figure out if it was possible.

So, as long as my mage, lock, and shaman do not all try and cast an aoe at a different distance relative to them - at the same time - it works fine.

(My little 5 man team is 1 bar from 85 woo hoo)