pyautoit icon indicating copy to clipboard operation
pyautoit copied to clipboard

control_click and control_send in Bluestacks

Open AnthonyZJiang opened this issue 5 years ago • 7 comments

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 avatar May 19 '20 12:05 AnthonyZJiang

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

AnthonyZJiang avatar May 20 '20 09:05 AnthonyZJiang

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 avatar Jul 29 '20 21:07 DoTheBestMayB

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")

DoTheBestMayB avatar Jul 29 '20 22:07 DoTheBestMayB

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

AnthonyZJiang avatar Jul 29 '20 22:07 AnthonyZJiang

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.

gruberdev avatar Aug 03 '20 17:08 gruberdev

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.

AnthonyZJiang avatar Aug 10 '21 21:08 AnthonyZJiang

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

daizichuan avatar Nov 23 '23 03:11 daizichuan