Beispiel #1
0
import lackey
from WindowMgr import *

# turn on the monitor
win32gui.SendMessage(win32con.HWND_BROADCAST, win32con.WM_SYSCOMMAND,
                     win32con.SC_MONITORPOWER, -1)

lackey.sleep(1)

lackey.Keyboard().keyDown(lackey.Key.PRINTSCREEN)
lackey.Keyboard().keyUp(lackey.Key.PRINTSCREEN)

# call the wechat window to foreground
w = WindowMgr()
w.find_window("WeChatMainWndForPC", "微信")
w.set_foreground()

lackey.Keyboard().keyDown(lackey.Key.PRINTSCREEN)
lackey.Keyboard().keyUp(lackey.Key.PRINTSCREEN)

lackey.sleep(1)
lackey.click(r"D:\Code\DAD\image\chat.jpg")
lackey.Mouse().move(60, 0)
lackey.sleep(1)
lackey.Mouse().wheel(1, 200)
# enter the subscription list
while True:
    try:
        lackey.click(r"D:\Code\DAD\image\subscription.jpg")
        break
    except:
Beispiel #2
0
 def setUp(self):
     self.kb = lackey.Keyboard()
Beispiel #3
0
 def setUp(self):
     self.kb = lackey.Keyboard()
     self.app = lackey.App("notepad.exe")
     self.app.open()
     time.sleep(1)