Page 1 of 1

Mousemove doesnt work in a vitrual machine

Posted: 30 Jun 2023, 08:22
by apolonas
[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

Re: Mousemove doesnt work in a vitrual machine

Posted: 30 Jun 2023, 08:29
by apolonas
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

Re: Mousemove doesnt work in a vitrual machine

Posted: 30 Jun 2023, 09:32
by guest3456
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)

Re: Mousemove doesnt work in a vitrual machine

Posted: 30 Jun 2023, 10:30
by apolonas
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?

Re: Mousemove doesnt work in a vitrual machine

Posted: 30 Jun 2023, 21:02
by lexikos
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.

Re: Mousemove doesnt work in a vitrual machine

Posted: 01 Jul 2023, 10:40
by apolonas
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 742 times