Sign in to follow this  
Followers 0
leonick5

Blockinput() not working in VMware

16 posts in this topic

I guess it has something to do with the mousedriver of VMware.

So probably it would not be possible to make it work in VMware....

but if anyone knows a solution, it would be appreciated. :D

Share this post


Link to post
Share on other sites



I use VMWare to text stuff in XP since I'm running Windows 7, but I haven't tried any BlockInput() in the VM. Is it blocking from the host side, and if input is captured by the VM it isn't blocking it, or just in the VM its self?


RAWR! I'm hungry :( Feed the panda squirrle

Share this post


Link to post
Share on other sites

I use VMWare to text stuff in XP since I'm running Windows 7, but I haven't tried any BlockInput() in the VM. Is it blocking from the host side, and if input is captured by the VM it isn't blocking it, or just in the VM its self?

You are right.. I gave too little info.

I am talking only about inside the guest.

So: Blockinput(in the VMware) doesn't block the mouse of the VMware.

Share this post


Link to post
Share on other sites

You sure about that? I just did

BlockInput(1)
Sleep(5000)
BlockInput(0)
and it blocked the input for me, except now... I think I broke it, and my mouse isn't responding at all even though the script has terminated... O.o what OS and version of VMware are you running?


RAWR! I'm hungry :( Feed the panda squirrle

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

The mouse driver is most likely the culprit. Especially considering that VMWare has that cool "move in and out of the VM window" thing.

Why are you trying to block input in a virtual machine in the first place?

Edited by Richard Robertson

Share this post


Link to post
Share on other sites

VMwarePlayer 3.0.0 build-197124 VMwaretools installed

HostOs & GuestOs: XP

In my HostOs its working perfectly.

Why are you trying to block input in a virtual machine in the first place?

Cause I am using mousemove() to automate.

And It doesn't work correctly, when I am using the mouse at the same time.

So I always used blockinput() to automate correctly.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Weird... I use VMWare Workstation, but I started it up in the Player, and it still blocked input, restricted mouse movement, etc.

My version is also a little bit newer (3.0.0 Build 203739)

You sure it's executing the BlockInput()?

Edited by mistersquirrle

RAWR! I'm hungry :( Feed the panda squirrle

Share this post


Link to post
Share on other sites

You sure it's executing the BlockInput()?

Not sure how you mean that.

Theres not much you can do wrong in the code.

As I said in the host its working.

I am sure it has something to do with the settings.

In WMware(not the player) I have checked all 5 boxes in Preferences-->Input

also: "optimize mouse for games" is automatic.

[VMwareTools(& adv.mouse driver) installed]

Share this post


Link to post
Share on other sites

BlockInput returns a value indicating whether it worked or not.

If Not BlockInput(True) Then MsgBox(0, "Error", "BlockInput didn't work")

Share this post


Link to post
Share on other sites

Oh didn't thought of the return value.

It returns >FALSE<

Share this post


Link to post
Share on other sites

That means that either another application has already blocked the input OR your program doesn't have permission to do so.

Share this post


Link to post
Share on other sites

BlockInput() needs permission? Seeing as it's a VM I don't know why he wouldn't have the right permissions to call it. If something else were already blocking the input... Then why's the mouse still able to move?


RAWR! I'm hungry :( Feed the panda squirrle

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

That means that either another application has already blocked the input OR your program doesn't have permission to do so.

I've already closed all unnecessary processes and autoit is running on the administrator acount.

But I just discovered, that while blockinput(1) is active I can move the mouse but not do any clicking...lol.

another interesting aspect:

When using mousemove() and only slightly moving the (real)mouse, mousemove is not performed at all.!!

Thats not the case in my host system, where mousemove() is performed even if the mouse is moved.

Edited by leonick5

Share this post


Link to post
Share on other sites

You have to remember that the VM doesn't get access to a real mouse. VMWare will move the mouse in the VM because it has to.

Does your guest OS have all service packs and whatnot installed?

Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

It seems for me like it works like that:

WMware is generally blocking the mouse(movement) of the guestXP.(Thats why blockinput() is returning false.

Instead its using its own mousecursor(Or the one of the Host XP), and blocking the GuestOS mouse,

and just passing the mouse-values(click) to the GuestOS-mouse.

That means if you are pressing a button, it sends this command to the GuestOS.

That also explains, if you use blockinput(), why the mouse is still moving(Its not the mouse of the GuestOS)

But after blockinput() VMware is not able to pass the click to the OS, because now not only the mousemovemt is blocked(by WMware), now also the clicking is blocked by blockinput()

That makes totally sense to me.

Just wondering why its working with mastersquirrels VM.??

Don't see any connection there to the updates??

But if you are keen to know:

All updates until 12/09

You have tested blockinput() yourself in a VM?

Edited by leonick5

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

Option Blockinput() works in AutoIt with Win7 only if you first use '#RequireAdmin' at first.

#RequireAdmin
BlockInput(1)
.
.
.

MsgBox(4096, "Info", "Now running with admin rights")
.
.
.

BlockInput(0)
Edited by CHRIS1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0