SavinaRoja / PyUserInput

A module for cross-platform control of the mouse and keyboard in python that is simple to install and use.
GNU General Public License v3.0
1.07k stars 244 forks source link

pymouse and pykeyboard does not work in the third-party software! or do I use them in a wrong way? #99

Open jzz3933 opened 7 years ago

jzz3933 commented 7 years ago

Hi ,

I am writing a program to control a software to realize the auto-click ,but neither the pymouse nor pyketboard worked ,,that means there is no response of the software, even the software is on the top of the screen. I dont know how to solve the problem, beg for your help. Below is my program:

win32api.ShellExecute(0,'open','C:\Users\Jzz\AppData\Local\\ 770bc6656ddf6c8f26bf2a92e4b368e3\770bc6656ddf6c8f26bf2a92e4b368e3.exe','','',1)

time.sleep(3)

m = pymouse.PyMouse() k = pykeyboard.PyKeyboard()

print ('2')

time.sleep(1) k.tap_key(k.enter_key,n=2,interval=1)

print ('3')

x_dim,y_dim = m.screen_size() x_pos = int(x_dim/2) y_pos = int(y_dim/2+72) print(x_pos) print(y_pos) print(m.position()) m.move(x_pos,y_pos) m.click(x_pos,y_pos,1)