jacexh / pyautoit

Python binding for AutoItX3.dll
MIT License
266 stars 74 forks source link

control_click and control_send in Bluestacks #32

Open AnthonyZJiang opened 4 years ago

AnthonyZJiang commented 4 years ago

Has anyone had any issue with control_click and control_send in Bluestacks?

The following AU3 code works fine:

ControlFocus("BlueStacks", "", "" )
ControlClick("BlueStacks", "", "", "left", 1, 645, 626)
ControlSend("BlueStacks", "", "", "123")

But the python translation of the above code doesn't work:

import autoit

autoit.control_focus("BlueStacks", "") #this works
autoit.control_click("BlueStacks", "", x=615, y=654) #doesn't work, no error message, just doesn't click
autoit.control_send("BlueStacks", "", "123") #doesn't work, no error message, just text doesn't get sent

Also, other control functions such as control_hide and control_show work well.

AnthonyZJiang commented 4 years ago

I figured it has to be an issue with the included AutoItX3.dll, so I replaced them with the ones found in my AutoIt folder. Now control_click and control_send works well. I haven't done any conclusive test of the dll but all my old scripts still work. They use mouse_click and send.

Maybe it worth to test them fully. lib.zip

DoTheBestMayB commented 4 years ago

I have same issue(only focus works)

  1. Replacing dll file with what you upload is not help.
  2. I install autoit, and replace dll file with dll included in autoit. But not help.

Is there any suggestion for solving this problem?

DoTheBestMayB commented 4 years ago

Below code works.

autoit.control_focus("BlueStacks", "")
autoit.control_send("BlueStacks", "", send_text="1")

But below code not works

# autoit.control_focus("BlueStacks", "")
autoit.control_send("BlueStacks", "", send_text="1")
AnthonyZJiang commented 4 years ago

For Bluestacks, you have to control focus first. This is an issue with Bluestacks.

gruberdev commented 4 years ago

I figured it has to be an issue with the included AutoItX3.dll, so I replaced them with the ones found in my AutoIt folder. Now control_click and control_send works well. I haven't done any conclusive test of the dll but all my old scripts still work. They use mouse_click and send.

Maybe it worth to test them fully. lib.zip

Can you make a branch with these files? I'd be highly valuable for other Bluestacks users as well.

Edit: I can confirm this patch works. Use as its own discretion.

AnthonyZJiang commented 3 years ago

I figured it has to be an issue with the included AutoItX3.dll, so I replaced them with the ones found in my AutoIt folder. Now control_click and control_send works well. I haven't done any conclusive test of the dll but all my old scripts still work. They use mouse_click and send. Maybe it worth to test them fully. lib.zip

Can you make a branch with these files? I'd be highly valuable for other Bluestacks users as well.

Edit: I can confirm this patch works. Use as its own discretion.

The latest dll is version 3.3.14.5.

The list of changes in these API can be found here: Release notes Script breaking changes

I might be able to spend some time on getting the dll updated in a few days/weeks.

daizichuan commented 9 months ago

I don't know what is Bluestacks.Maybe i have same question. when i use Windows cmd,if i run py script as administrator 以管理员运行,it works!wish this could help u! by the way, pycharm run as administrator, it works too