當前位置: 首頁>>代碼示例>>Python>>正文


Python pyautogui.keyUp方法代碼示例

本文整理匯總了Python中pyautogui.keyUp方法的典型用法代碼示例。如果您正苦於以下問題:Python pyautogui.keyUp方法的具體用法?Python pyautogui.keyUp怎麽用?Python pyautogui.keyUp使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pyautogui的用法示例。


在下文中一共展示了pyautogui.keyUp方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: type_with_keys_down

# 需要導入模塊: import pyautogui [as 別名]
# 或者: from pyautogui import keyUp [as 別名]
def type_with_keys_down(self, text, *keys):
        '''Press keyboard keys down, then write given text, then release the
        keyboard keys.

        See valid keyboard keys in `Press Combination`.

        Examples:

        | Type with keys down | write this in caps  | Key.Shift |
        '''
        valid_keys = self._validate_keys(keys)
        for key in valid_keys:
            ag.keyDown(key)
        ag.typewrite(text)
        for key in valid_keys:
            ag.keyUp(key) 
開發者ID:eficode,項目名稱:robotframework-imagehorizonlibrary,代碼行數:18,代碼來源:_keyboard.py

示例2: release

# 需要導入模塊: import pyautogui [as 別名]
# 或者: from pyautogui import keyUp [as 別名]
def release(key):
    # keyboard_controller.release(key)
    pyautogui.keyUp(key) 
開發者ID:nimaid,項目名稱:LPHK,代碼行數:5,代碼來源:keyboard_unix.py

示例3: locate_gmail

# 需要導入模塊: import pyautogui [as 別名]
# 或者: from pyautogui import keyUp [as 別名]
def locate_gmail():
    
    #Sleep for a while and wait for Firefox to open
    time.sleep(3)

    # 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(6)

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

    # Locate the form
    pyautogui.press('tab')
 
    time.sleep(2)

    _gmail_ = pyautogui.locateOnScreen('images/gmail_form.png')
    formx, formy = pyautogui.center(_gmail_)
    pyautogui.click(formx, formy)
    
    # Check and print message
    if not pyautogui.click(formx, formy):
        msg(1,'Located the form.')
    else:
        msg(3,'Failed to locate the form.')
        ext()


# Function used to randomize credentials 
開發者ID:unix121,項目名稱:gmail-generator,代碼行數:39,代碼來源:gmail_generator.py

示例4: key_up

# 需要導入模塊: import pyautogui [as 別名]
# 或者: from pyautogui import keyUp [as 別名]
def key_up(key):
        """Performs a keyboard key release (without the press down beforehand).

        :param key: The key to be released up.
        :return: None.
        """
        if isinstance(key, Key):
            pyautogui.keyUp(key.value.label)
        elif isinstance(key, str):
            if pyautogui.isValidKey(key):
                pyautogui.keyUp(key)
            else:
                raise ValueError("Unsupported Key input.")
        else:
            raise ValueError("Unsupported Key input.") 
開發者ID:mozilla,項目名稱:iris,代碼行數:17,代碼來源:keyboard.py

示例5: do_work

# 需要導入模塊: import pyautogui [as 別名]
# 或者: from pyautogui import keyUp [as 別名]
def do_work(self):
        pyautogui.keyDown('s')
        time.sleep(1)
        pyautogui.keyUp('s')
        pyautogui.keyDown('s')
        time.sleep(1)
        pyautogui.keyUp('s')
        pyautogui.keyDown('s')
        time.sleep(1)
        pyautogui.keyUp('s')
        pyautogui.keyDown('s')
        time.sleep(1)
        pyautogui.keyUp('s')
        print('Zoomed out.')
        self.next() 
開發者ID:Sunuba,項目名稱:roc,代碼行數:17,代碼來源:Commands.py


注:本文中的pyautogui.keyUp方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。