python类keyUp()的实例源码

mouse_simulation_test.py 文件源码 项目:base_function 作者: Rockyzsu 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def example():
    screenWidth, screenHeight = pg.size()
    currentMouseX, currentMouseY = pg.position()
    pg.moveTo(500, 550)
    pg.click()
    pg.moveRel(None, 10)  # move mouse 10 pixels down
    pg.doubleClick()
    # pg.moveTo(500, 500, duration=2, tween=pyautogui.tweens.easeInOutQuad)  # use tweening/easing function to move mouse over 2 seconds.
    pg.typewrite('Hello world!', interval=0.25)  # type with quarter-second pause in between each key
    pg.press('esc')
    pg.keyDown('shift')
    pg.press(['left', 'left', 'left', 'left', 'left', 'left'])
    pg.keyUp('shift')
    pg.hotkey('ctrl', 'c')
    delta_y = 50
__init__.py 文件源码 项目:Nightchord 作者: theriley106 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def applyChain(file):
    p = subprocess.Popen(["audacity", "./{}".format(file)])
    time.sleep(7)
    try:
        pyautogui.click(pyautogui.locateCenterOnScreen('src/images/discard.png'))
        time.sleep(1)
        pyautogui.click(pyautogui.locateCenterOnScreen('src/images/yes.png'))
    except:
        pass

    time.sleep(1)
    if len(list(pyautogui.locateAllOnScreen('src/images/audacity_fileButton.png'))) > 1:
        pyautogui.keyDown('alt')
        pyautogui.press('f10')
        pyautogui.keyUp('alt')
    time.sleep(1)
    pyautogui.click(pyautogui.locateCenterOnScreen('src/images/audacity_fileButton.png'))
    time.sleep(2)
    pyautogui.click(pyautogui.locateCenterOnScreen('src/images/audacity_applyChain.png'))
    time.sleep(2)
    pyautogui.click(pyautogui.locateCenterOnScreen('src/images/audacity_applyToCurrentFile.png'))
    time.sleep(10)
    p.terminate()
    print('Done')
__init__.py 文件源码 项目:skill-autogui 作者: eClarity 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def handle_select_combination_intent(self, message):
        self.speak("Selecting all")
        pyautogui.hotkey("ctrl", "a")
        if message.data.get("PasteKeyword"):
            self.handle_paste_intent(message)
        elif message.data.get("CopyKeyword"):
            self.handle_copy_intent(message)
        elif message.data.get("CutKeyword"):
            self.handle_cut_intent(message)
        elif message.data.get("DeleteKeyword"):
            self.speak("deleting")
            pyautogui.keyDown("delete")
            pyautogui.keyUp("delete")
main.py 文件源码 项目:Nightchord 作者: theriley106 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def maxWindow():
    try:
        pyautogui.click(pyautogui.locateCenterOnScreen('src/images/discard.png'))
        time.sleep(1)
        pyautogui.click(pyautogui.locateCenterOnScreen('src/images/yes.png'))
    except:
        pass

    time.sleep(1)
    if len(list(pyautogui.locateAllOnScreen('src/images/audacity_fileButton.png'))) > 1:
        pyautogui.keyDown('alt')
        pyautogui.press('f10')
        pyautogui.keyUp('alt')
game_control.py 文件源码 项目:Controller-Hand 作者: ardamavi 项目源码 文件源码 阅读 63 收藏 0 点赞 0 评论 0
def release():
    pyautogui.keyUp('space')
gmail_generator.py 文件源码 项目:gmail-generator 作者: unix121 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def locate_gmail():

    #Sleep for a while and wait for Firefox to open
    time.sleep(2)

    # Printing message
    msg(1,'Opening Gmail...')

    # Typing the website on the browser
    pyautogui.keyDown('ctrlleft');  pyautogui.typewrite('a'); pyautogui.keyUp('ctrlleft')
    pyautogui.typewrite('https://accounts.google.com/SignUp?service=mail&continue=https%3A%2F%2Fmail.google.com%2Fmail%2F&ltmpl=default')
    pyautogui.typewrite('\n')

    # Wait for a while until the website responds
    time.sleep(3)

    # Print a simple message
    msg(1,'Locating the form...')

    # Locate the form
    _gmail_=pyautogui.locateOnScreen('images/gmail_form.png')
    _form_=pyautogui.center(_gmail_)

    # Check and print message
    if not pyautogui.click(_form_):
        msg(1,'Located the form.')
    else:
        msg(3,'Failed to locate the form.')
        ext()


# Function used to randomize credentials
__init__.py 文件源码 项目:skill-autogui 作者: eClarity 项目源码 文件源码 阅读 35 收藏 0 点赞 0 评论 0
def handle_press_key_intent(self, message):
        key = message.data.get('Key')
        self.speak("Pressing %s" % key)
        pyautogui.keyDown(key)
        pyautogui.keyUp(key)
__init__.py 文件源码 项目:skill-autogui 作者: eClarity 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def handle_release_key_intent(self, message):
        key = message.data.get('Key')
        self.speak("Releasing %s key" % key)
        pyautogui.keyUp(key)
Keyboard.py 文件源码 项目:osrmacro 作者: jjvilm 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def type_this(strings):
    """Types the passed characters with random pauses in between strokes"""
    for s in strings:
        # delay between key presses--key UP/DOWN
        #autopy.key.toggle(s, True)
        pyautogui.keyDown(s)
        RandTime.randTime(0,0,0,0,0,9)
        pyautogui.keyUp(s)
        # delay after key UP--next key


问题


面经


文章

微信
公众号

扫码关注公众号