ClickControl for a VM Machine

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
infiskillz
Posts: 6
Joined: 18 Apr 2017, 13:31

ClickControl for a VM Machine

23 May 2017, 10:01

Hello guys,

I need help with a ClickControl command that I need working in a VM machine. Outside of the VM, my commands work, however inside, they don't seem to. Here's the command:

Code: Select all

NumpadMult::
ControlClick, x210 y158, VM-Name, , LEFT, 2, , , , ,
return
Same command works if I use it for something outside of the VM, but inside, it doesn't. Do you have any ideas? Does it have anything to do with the fact that the class is ahk_class #32770? As I'm not really sure what that means, but I thought I'd throw it out there. I tried it with the name of the VM (since it doesn't change), as well as the exe, but it didn't work with either.

Image

Any suggestions?
User avatar
WalkerOfTheDay
Posts: 710
Joined: 24 Mar 2016, 03:01

Re: ClickControl for a VM Machine

23 May 2017, 11:08

Is your VM a Windows OS?
You could try installing AHK in the VM itself.
(Or did you already do that?)
guest3456
Posts: 3463
Joined: 09 Oct 2013, 10:31

Re: ClickControl for a VM Machine

23 May 2017, 11:13

yes i would not expect ControlClick to work if you are running it from the host machine and expecting to execute a click within the guest

just install AHK inside the guest machine and run the script inside as well

infiskillz
Posts: 6
Joined: 18 Apr 2017, 13:31

Re: ClickControl for a VM Machine

23 May 2017, 11:33

Simple text commands are working though, such as

Code: Select all

^NumpadMult::

SendInput Hello.{Enter}
sleep 500
return
What I need this to do is to have it click in a specific place (at specific coords) when I hit the key (numpad or something else). If ControlClick doesn't work for this, is there a different way of doing it? Maybe with the click command itself?


Worst case scenario, I'd be satisfied even if I select the specific window where I want the click to go manually, not from the script, and the command would simply click in a specific place of the screen, regardless of what window I have active etc. That would work for me too, if there's no other way.

Later edit:

I combined "MouseClick" with "WinActivate" and it worked. Thanks for you answers guys!

For anyone that's curious, this is what I ended up with that worked:

Code: Select all

NumpadMult::

WinActivate, VM-Name,,,
MouseClick, , 109,823, 2, 0,,
sleep 200
return
Thanks again.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 382 guests