• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python pyautogui.hotkey函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中pyautogui.hotkey函数的典型用法代码示例。如果您正苦于以下问题:Python hotkey函数的具体用法?Python hotkey怎么用?Python hotkey使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了hotkey函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: send_command

 def send_command(self, cmd):
     self.save_screenshot()
     pyautogui.hotkey('ctrl', 'space')
     pyautogui.typewrite(cmd)
     self.save_screenshot()
     pyautogui.press('enter')
     pyautogui.press('escape')
开发者ID:ThierryM,项目名称:bCNC,代码行数:7,代码来源:base.py


示例2: printscores

def printscores():
	#note only works in Firefox
	#selects all of the scores
	try:
		selectall =  WebDriverWait(browser, 3).until(EC.presence_of_element_located((By.ID, "m_m_mid_mid_ReportByDate2_rptDataView_ctl00_ctl02_ctl01_GridClientSelectColumnSelectCheckBox")))   
		selectall.click()
	except:
		pass
	#exports to pdf
	export = WebDriverWait(browser, 2).until(EC.presence_of_element_located((By.ID, "m_m_top_wel_imgBtnExport"))) 
	export.click()
	logging.debug("Still working")
	#chooses pdf from the popup
	browser.switch_to.frame('rwPreview')
	choosepdf = WebDriverWait(browser, 2).until(EC.presence_of_element_located((By.ID, "radio4")))
	choosepdf.click()
	donebutton = browser.find_element_by_id('imgBtnDone')
	donebutton.click()
	#todo let it continue when the pdf downloads and break if it does not download
	
		
	time.sleep(5)
	pyautogui.press('enter')
	time.sleep(2)
	pyautogui.hotkey('ctrl', 'j')
	time.sleep(2)
	pyautogui.press('enter')
	time.sleep(4)
	pyautogui.hotkey('ctrl', 'p')
	time.sleep(4)
	pyautogui.press('enter')
	time.sleep(4)
	pyautogui.typewrite(printcode)
	pyautogui.press('enter')
开发者ID:jharrison12,项目名称:workrelated01,代码行数:34,代码来源:printscores.py


示例3: episode_get_mcn_and_ref

def episode_get_mcn_and_ref():
    # get mcn
    mcn = pyperclip.copy('na')
    pya.moveTo(424, 474, duration=0.1)
    pya.dragTo(346, 474, duration=0.1)
    pya.hotkey('ctrl', 'c')
    mcn = pyperclip.paste()
    pya.moveTo(424, 474, duration=0.1)
    pya.click(button='right')
    pya.moveTo(481, 268, duration=0.1)
    pya.click()
    
    mcn = pyperclip.paste()
    mcn = mcn.replace(' ', '')
    # get ref
    ref = pyperclip.copy('na')
    pya.moveTo(500, 475, duration=0.1)
    pya.dragRel(-8, 0, duration=0.1)
    pya.hotkey('ctrl', 'c')
    ref = pyperclip.paste()
    pya.moveRel(8, 0, duration=0.1)
    pya.click(button='right')
    pya.moveTo(577, 274, duration=0.1)
    pya.click()
    
    ref = pyperclip.paste()
    return mcn, ref
开发者ID:varnell-holdings,项目名称:new_billing,代码行数:27,代码来源:login_and_run.py


示例4: FillinExcelxCV1

def FillinExcelxCV1():
              # Close current edit area
              xCloseN=(399,200)
              pyautogui.moveTo(xCloseN)
              time.sleep(0.25)
              pyautogui.click()
              time.sleep(0.1)
              
              # Back to Excel
              xExcel=(337,746)
              xExcelDown=(1356,670)
              xCellEditC=(267,238)
              pyautogui.moveTo(xExcel)
              time.sleep(0.25)
              pyautogui.click()
              time.sleep(0.5)
              
              # Move and Paste in C
              pyautogui.moveTo(xCellEditC)
              time.sleep(0.25)
              pyautogui.click()
              time.sleep(0.1)

              pyautogui.hotkey('ctrl','v')
              time.sleep(0.1)
              pyautogui.hotkey('ctrl','s') #Save Excel
              time.sleep(1.5)

              pyautogui.moveTo(xExcelDown)
              time.sleep(0.25)
              pyautogui.click()
              time.sleep(0.5)
开发者ID:csnow798,项目名称:Hello-World,代码行数:32,代码来源:checkKBFromExcel20180420v3.py


示例5: cut

def cut(link, FolderName):
    global UserName
    global Password
    global WaitTime
    global ChromiumBinary
    global UserNameLocation
    global PasswordLocation
    global PrepdButtonLocation
    global FolderSelectLocation
    global CatchButtonLocation
    global FirstBool

    print "Link: " + link
    print "Folder Name: " + FolderName + "\n"

    Popen([ChromiumBinary, "--incognito", link])
    print "went to rss link"
    time.sleep(WaitTime)

    pyautogui.moveTo(PrepdButtonLocation[0], PrepdButtonLocation[1])
    pyautogui.click()
    print "clicked on prepd button"
    time.sleep(WaitTime)

    if FirstBool == True:
        #login
        time.sleep(WaitTime)

        pyautogui.moveTo(PasswordLocation[0], PasswordLocation[1])
        pyautogui.click()
        pyautogui.typewrite(Password, interval=0.05)
        print "typed password"

        pyautogui.moveTo(UserNameLocation[0], UserNameLocation[1])
        pyautogui.click()
        pyautogui.typewrite(UserName, interval=0.05)
        print "typed username"

        pyautogui.press('enter')
        print "logged in"

        time.sleep(WaitTime)

    pyautogui.moveTo(FolderSelectLocation[0], FolderSelectLocation[1])
    pyautogui.click()
    print "clicked on folder selection"

    pyautogui.typewrite(FolderName, interval=0.05)
    pyautogui.press('enter')
    print "typed into folder selection"

    pyautogui.moveTo(CatchButtonLocation[0], CatchButtonLocation[1])
    pyautogui.click()
    time.sleep(WaitTime)
    print "caught article"

    pyautogui.press("esc")

    pyautogui.hotkey('ctrl', 'w')
    print "closed tab\n"
开发者ID:isaaclo123,项目名称:prepdbot_server,代码行数:60,代码来源:prepdbot_client.py


示例6: quoteOSHPark

    def quoteOSHPark(self):
        """Function for navigating OSHPark's website."""

        url, user, pw = self.readConfig('oshpark', 'rigid')
        # Open new tab and go to URL
        self.newTab()
        self.driver.get(url)
        # Enter login information
        self.driver.find_element_by_css_selector('#user_email').send_keys(user)
        self.driver.find_element_by_css_selector('#user_password').send_keys(pw)
        # Click login button
        self.driver.find_element_by_css_selector('.buttons > input:nth-child(1)').click()

        self.driver.find_element_by_css_selector('#ember291').click()
        self.driver.find_element_by_css_selector('#file_selector > input:nth-child(2)').click()

        e = EWMH()
        windows = e.getClientList()
        for window in windows:
            if e.getWmName(window) == 'File Upload':
                time.sleep(0.5)
                e.setActiveWindow(window)
                e.display.flush()

        time.sleep(0.5)
        pyautogui.hotkey('ctrl', 'a')
        pyautogui.press('backspace')
        # '''get file location from config file'''
        # pyautogui.typewrite(fileLocation)
        pyautogui.press('return')
开发者ID:antonbilbaeno,项目名称:gitpcb,代码行数:30,代码来源:InstantQuote.py


示例7: episode_gp

def episode_gp():
    pya.hotkey('alt', 'a')
    pya.typewrite(['tab'] * 4, interval=0.1)
    gp = pyperclip.copy('empty')
    pya.hotkey('ctrl', 'c')
    gp = pyperclip.paste()
    return gp
开发者ID:varnell-holdings,项目名称:new_billing,代码行数:7,代码来源:login_and_run.py


示例8: switchTabWindow

	def switchTabWindow(self, direction):
		#left = 0, right = 1
		if direction == 0:
			pag.hotkey('command', 'shift', '[')
		elif direction == 1:
			pag.hotkey('command', 'shift', ']')
		else:
			assert direction == 0 or direction == 1, "Actor::switchWindow: wrong direction"
开发者ID:gdoggg2032,项目名称:MSAR,代码行数:8,代码来源:actor_beta.py


示例9: perform_action

	def perform_action(self, clazz):
		if clazz == 'flip':
			pyautogui.hotkey('command', 'space')
		elif clazz == 'top_down':
			pyautogui.press('space')
		elif clazz == 'right_left':
			pyautogui.press('right')
		print "dummy"
开发者ID:gitanuj,项目名称:gesture-recog,代码行数:8,代码来源:phonehelp.py


示例10: loadSymbolInChart

def loadSymbolInChart(msComponents, symbol):
    pyautogui.moveTo(msComponents['symbolEntry']['x'], msComponents['symbolEntry']['y'], 0.25)
    safeClick(msComponents['symbolEntry']['x'], msComponents['symbolEntry']['y'])
    pyautogui.hotkey(platform.primary_key_modifier, 'a')
    pyautogui.press('delete')
    pyautogui.typewrite(symbol)
    pyautogui.typewrite(['enter'])
    wait(DELAY_CHART_LOAD)
开发者ID:hn4002,项目名称:auto-save-mscharts,代码行数:8,代码来源:main.py


示例11: OnKeyboardEvent

def OnKeyboardEvent(event):
    if chr(event.Ascii) == 'i' and event.IsAlt():
        pyautogui.keyDown('alt')
        pyautogui.keyDown('shift')
        pyautogui.keyUp('shift')
        pyautogui.keyUp('alt')
        pyautogui.hotkey('ctrl', 'i')
        return False
    return True
开发者ID:nmix,项目名称:hotkeyway,代码行数:9,代码来源:hotkeyway.py


示例12: switchDesktop

	def switchDesktop(self, direction):

		#left = 0, right = 1
		if direction == 0:
			pag.hotkey('ctrl', 'left')
		elif direction == 1:
			pag.hotkey('ctrl', 'right')
		else:
			assert direction == 0 or direction == 1, "Actor::switchDesktop: wrong direction"
开发者ID:gdoggg2032,项目名称:MSAR,代码行数:9,代码来源:actor_beta.py


示例13: get_title

 def get_title():
     pya.hotkey('alt', 't')
     title = pyperclip.copy('na')
     pya.moveTo(190, 135, duration=0.1)
     pya.click(button='right')
     pya.moveRel(55, 65)
     pya.click()
     title = pyperclip.paste()
     return title
开发者ID:varnell-holdings,项目名称:new_billing,代码行数:9,代码来源:login_and_run.py


示例14: pass_search

def pass_search():
    pyautogui.PAUSE = 0.5
    pyautogui.FAILSAFE = False
    pyperclip.copy("")

    dondeEstaElBoton = pyautogui.locateOnScreen("go-button.png")
    if dondeEstaElBoton is None:
        print "El boton de GO no fue encontrado"

    else:
        botonPos = list(dondeEstaElBoton)
        print botonPos

    centroBoton = pyautogui.center(botonPos)
    print centroBoton

    contador = 0
    while True:
        contador += 1
        pyautogui.moveTo(centroBoton)
        pyautogui.moveRel(796, 0)  # Mover el raton a la barra de desplazamiento
        pyautogui.click(None, None, 2)
        # if contador == 1:
        #    time.sleep(0.3)
        #    pyautogui.typewrite('!reset')
        #    pyautogui.press('enter')

        pyautogui.click(None, None, 1)
        pyautogui.dragRel(0, -293, 1, button="left")
        # pyautogui.scroll(10)  #Hacer scroll para llegar a la parte superior del cuadro de texto
        # pyautogui.moveRel(0, -294)   #Mover el raton a la parte superior de la barra de desplazamiento
        pyautogui.moveRel(-390, 0)  # Mover el raton a la posicion en donde se encuentra la clave

        pyautogui.PAUSE = 0.05

        pyautogui.click(None, None, 2)
        # pyautogui.doubleClick()   #Hacer dobleclic en la palabra de la clave
        pyautogui.hotkey("ctrl", "c")

        # pyautogui.doubleClick()   #Hacer dobleclic en la palabra de la clave
        # pyautogui.hotkey('ctrl', 'c')

        # pyautogui.doubleClick()   #Hacer dobleclic en la palabra de la clave
        # pyautogui.hotkey('ctrl', 'c')
        pyautogui.PAUSE = 1

        r = pyperclip.paste()
        print r

        if len(r) == 10:
            print "clave encontrada"
            break
        if contador == 5:
            print "Se hizo el intento 5 veces para buscar la clave"
            break
        time.sleep(0.5)
开发者ID:josem-m,项目名称:pass_test,代码行数:56,代码来源:lv-mani.py


示例15: typeAndSave

    def typeAndSave(self, msg):
        """
        A matching keystroke is sent for each character in msg.
        Afterwards, ctrl+s is sent.
        """
        keys = list(msg) + ["enter"]
        pyautogui.typewrite(keys, interval=0.05)
        pyautogui.hotkey("ctrl", "s")

        time.sleep(1)
开发者ID:Enaero,项目名称:OfficeCrawler,代码行数:10,代码来源:office_crawler.py


示例16: scene

def scene(key, name, time, lock):
    pyautogui.hotkey('winleft', 'alt', 'shift', str(key), interval=0.1)
    stoptimer()
    global timer
    if lock:
      name = name + ' Locked'
    timer = count_down('Scene: '+name+' (', time)
    timer.start()
    if lock:
      time.sleep(time)
开发者ID:LXXero,项目名称:scripts,代码行数:10,代码来源:tanks.py


示例17: do_action

def do_action(action):
    print action 
    if "url" in action:
        handle_url_action(action)
    if "media" in action or "volume" in action: 
        handle_media_keys(action)
    if "screen" in action:
        handle_screen(action)
    keys = action.lower().split('_')
    pyautogui.hotkey(*keys)
开发者ID:sudssm,项目名称:Beyond,代码行数:10,代码来源:actuator.py


示例18: gmail

 def gmail(self):
     '''
     Starts Firefox. Navigates to Gmail.
     '''
     startfile(r'C:\Program Files (x86)\Mozilla Firefox\firefox.exe')
     sleep(5)
     hotkey('ctrl','l')
     sleep(2)
     typewrite('www.gmail.com')
     press('enter')
     sleep(2)
开发者ID:Schwartz210,项目名称:QuickBooks-interface,代码行数:11,代码来源:startup.py


示例19: pyautogui_add_one_file

    def pyautogui_add_one_file(full_path):
        if full_path:
            pyperclip.copy(full_path)
            pyautogui.press('down')

            i = 1
            while i < 9:
                i += 1
                pyautogui.press('tab')
            pyautogui.hotkey('ctrl', 'v')
            pyautogui.press('enter')
            pyautogui.press('enter')
开发者ID:tricky-duck,项目名称:dms_nose,代码行数:12,代码来源:media.py


示例20: play

def play():
	pyautogui.hotkey('winleft', '9')
	time.sleep(0.5)
	pyautogui.hotkey('ctrl', 't')
	pyautogui.typewrite('http://www.kanyezone.com/', interval = 0.05)
	pyautogui.press('enter')
	time.sleep(4)
	# pyautogui.press('enter')
	pyautogui.keyDown('right')
	time.sleep(0.25)
	pyautogui.keyUp('right')
	tick()
开发者ID:sandhoefner,项目名称:sandhoefner.github.io,代码行数:12,代码来源:main.py



注:本文中的pyautogui.hotkey函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python pyautogui.keyDown函数代码示例发布时间:2022-05-25
下一篇:
Python pyautogui.click函数代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap