Mousemove doesnt work in a vitrual machine

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
apolonas
Posts: 43
Joined: 30 Apr 2014, 11:50

Mousemove doesnt work in a vitrual machine

30 Jun 2023, 08:22

[Moderator's note: Topic moved from Bug Reports.]

I tried to use mousemove command in vmware and it doesn't work. I use windows 10 ltsc in the testing vitrual machine. Ahkv1 mousemove works flawlessly btw in the same machine. Also compiled command doesn't work either. I tried to install ahkv2 , use portable mod also use compiled executable nothing works...

Code: Select all

MouseMove 0,0
Attachments
mousemove.rar
(609.91 KiB) Downloaded 41 times
apolonas
Posts: 43
Joined: 30 Apr 2014, 11:50

Re: Mousemove doesnt work in a vitrual machine

30 Jun 2023, 08:29

I just tried

Code: Select all

CoordMode "Mouse", "Screen"
MouseMove 20, 30, 50

Code: Select all

CoordMode "Mouse", "window"
MouseMove 20, 30, 50
also doesn't work
guest3456
Posts: 3463
Joined: 09 Oct 2013, 10:31

Re: Mousemove doesnt work in a vitrual machine

30 Jun 2023, 09:32

it never worked for me on ahk v1 for years inside virtualbox

i always had to use SetCursorPos

Code: Select all

DllCall("SetCursorPos", "int", 200, "int", 100)

apolonas
Posts: 43
Joined: 30 Apr 2014, 11:50

Re: Mousemove doesnt work in a vitrual machine

30 Jun 2023, 10:30

guest3456 wrote:
30 Jun 2023, 09:32
it never worked for me on ahk v1 for years inside virtualbox

i always had to use SetCursorPos

Code: Select all

DllCall("SetCursorPos", "int", 200, "int", 100)
funny thing ahkv1 mousemove works ahkv2 doesnt.

Code: Select all

DllCall("SetCursorPos", "int", 200, "int", 100)
doesnt work for eather version xaxa maybe dll is missing?
lexikos
Posts: 9635
Joined: 30 Sep 2013, 04:07
Contact:

Re: Mousemove doesnt work in a vitrual machine

30 Jun 2023, 21:02

It works just fine for me in VirtualBox. For instance, this will show a context menu at the top-left of the screen:

Code: Select all

CoordMode "Mouse"
MouseMove 0,0
Click "R"
The VM has no control over the host's mouse cursor, and this is as it should be. If you turn off mouse integration, you will be able to see the guest's mouse pointer, and you will likely see that MouseMove does move it.

If there is some difference in behaviour between v1 and v2, it could be attributed to the default Send mode.
apolonas
Posts: 43
Joined: 30 Apr 2014, 11:50

Re: Mousemove doesnt work in a vitrual machine

01 Jul 2023, 10:40

lexikos wrote:
30 Jun 2023, 21:02
It works just fine for me in VirtualBox. For instance, this will show a context menu at the top-left of the screen:

Code: Select all

CoordMode "Mouse"
MouseMove 0,0
Click "R"
The VM has no control over the host's mouse cursor, and this is as it should be. If you turn off mouse integration, you will be able to see the guest's mouse pointer, and you will likely see that MouseMove does move it.

If there is some difference in behaviour between v1 and v2, it could be attributed to the default Send mode.
I added the line

Code: Select all

SendMode "event"
at the top of the script and now mouse works as expected except the loading icon on desktop. Also I notice that mouse worked before but it was invisible (i tested right click). Is there any workaround? I don't know what the difference between send modes unfortunately.
image.png
image.png (5.64 KiB) Viewed 534 times

Return to “Ask for Help (v2)”

Who is online

Users browsing this forum: Albireo, Draken, RussF and 41 guests