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

Python pyautogui.keyUp函数代码示例

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

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



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

示例1: play

def play():
    #get sensor data
    s.getSensorData()
    #sense keypress
    global rc_prev
    rc = s.RemoteCode
    #remove double clicks
    if not (rc == rc_prev):
        if rc  == '6C90':
            hmi.keyDown('up')
            hmi.keyUp('up')
        elif rc == 'CC30':
            hmi.keyDown('down')
            hmi.keyUp('down')
        elif rc == 'AC50':
            hmi.keyDown('right')
            hmi.keyUp('right')
        elif rc == '8C70':
            hmi.keyDown('left')
            hmi.keyUp('left')
        elif rc == '9C60':
            hmi.keyDown('p')
            hmi.keyUp('p')
        rc_prev = rc
    s.ledWrite(Red, On)
    wait(20)
    s.ledWrite(Red, Off)
    wait(20)
开发者ID:BOBRAPHTONE,项目名称:scratch-n-sketch,代码行数:28,代码来源:pacman.py


示例2: play_music

def play_music(url):
    webbrowser.open(url, 0, autoraise=False)
    time.sleep(0.1)
    pyautogui.keyDown("Alt")
    pyautogui.keyDown("Tab")
    pyautogui.keyUp("Alt")
    pyautogui.keyUp("Tab")
开发者ID:ofer515,项目名称:project,代码行数:7,代码来源:start.py


示例3: resize

def resize(n, dir):
    pag.keyDown('winleft')
    pag.press('r')
    pag.keyUp('winleft')
    for i in range(n):
        pag.press(dir)
    pag.press('escape')
开发者ID:MartinBlondin,项目名称:vimconfig,代码行数:7,代码来源:i3_pyautogui_bindings.py


示例4: _release

def _release(char):
    # Convert to pyAutoGui char
    if char in _ARD_TO_PYAUTOGUI_KEYS:
        char = _ARD_TO_PYAUTOGUI_KEYS[char]

    _pressed_list.remove(char)
    pyautogui.keyUp(char)  # Verify
开发者ID:sagielevy,项目名称:Kommander,代码行数:7,代码来源:MessageHandler.py


示例5: setGameOutput

    def setGameOutput(self,output):

        self.gameOutput = output
        self.gameOutputString = self.getDiscreteState(output)

        if (self.gameOutputString == 'DOWN'):
          # Skew
          pyautogui.keyUp('up')
          pyautogui.keyDown('down')
        elif (self.gameOutputString == 'NORM'):
          # DO Nothing
          pyautogui.keyUp('up')
          pyautogui.keyUp('down')
        else:

            # Filter JUMP
            if (self.lastOutputSet != 'JUMP'):
                self.lastOutputSetTime = time.time()

            # JUMP
            # Check if hasn't jump for more than 3 continuous secconds
            if (time.time() - self.lastOutputSetTime < 3000):
                pyautogui.keyUp('down')
                pyautogui.keyDown('up')
            else:
                pyautogui.keyUp('up')
                pyautogui.keyDown('down')

         
        self.lastOutputSet = self.gameOutputString
开发者ID:ajaiswal-ht,项目名称:imdino,代码行数:30,代码来源:game_manipulator_b.py


示例6: tick

def tick(direction='right', count=0):
	global oldIm
	global newIm
	# no sleep but there's a long step size... is it hanging on the screenshot???
	# screenGrab(count)

	# oldPath, newPath = None, None
	if count is 0:
		newIm = screenGrab(count)
	else:
		oldIm = newIm
		newIm = screenGrab(count)

		# shouldn't be getcwding every time
		# oldPath = os.getcwd() + '/caps/' + str(count - 1) + '.png'
		# oldPath = s
		# newPath = os.getcwd() + '/caps/' + str(count) + '.png'
	# direction = bestMove(oldPath, newPath)
	oldDirection = direction
	direction = bestMove(oldIm, newIm)

	if oldDirection not in ['space','sit']:
		pyautogui.keyUp(oldDirection)
	if direction not in ['space','sit']:

		pyautogui.keyDown(direction)
		# time.sleep(0.05)
	elif direction == "space":
		pyautogui.press('space')
	count += 1
	tick(direction, count)
开发者ID:sandhoefner,项目名称:sandhoefner.github.io,代码行数:31,代码来源:main.py


示例7: do_right

def do_right(area):
    print area
    if area > 33000 and pressedAtt == 0:
	pyautogui.keyDown("enter")
	pyautogui.keyUp("enter")
	global pressedAtt
	pressedAtt = 1
	print "ATT"

    if area < 10000 and pressedDef == 0:
	pyautogui.keyDown("ctrlright")
	
	global pressedDef
	pressedDef = 1
	print "DEF"
	
    else:
        if pressedAtt == 1 and area < 33000:
		global pressedAtt
		pressedAtt = 0
	if pressedDef == 1 and area > 10000:
		print "DUPA"
		pyautogui.keyUp("ctrlright")
		global pressedDef
		pressedDef = 0
开发者ID:plizonczyk,项目名称:AGHacks-2015,代码行数:25,代码来源:hajs.py


示例8: zoom_out

def zoom_out(scale):
    pyautogui.keyDown('ctrlleft')
    for x in range(0,scale):
        print("zooming out")
        pyautogui.keyDown('-')
        pyautogui.keyUp('-')
    pyautogui.keyUp('ctrlleft')
    return True
开发者ID:deeru10,项目名称:Crawler_testing,代码行数:8,代码来源:simulate_click.py


示例9: clicker

def clicker(coordinate):  # generate click event on a particular coordinate
    x = coordinate
    pyautogui.keyDown('ctrlleft')
    print(x)
    pyautogui.moveTo(x[0], x[1], duration=0.1) # This duration specifies how speed the mouse travels
    pyautogui.click(x[0], x[1])
    pyautogui.keyUp('ctrlleft')
    return True
开发者ID:deeru10,项目名称:Crawler_testing,代码行数:8,代码来源:simulate_click.py


示例10: startup_menu

def startup_menu():
    """
    this method shows the startup menu....
    """
    p.keyDown('alt')
    p.keyDown('f1')
    p.keyUp('f1')
    p.keyUp('alt')
开发者ID:girish946,项目名称:SG-remote,代码行数:8,代码来源:commands.py


示例11: make

 def make(recipe):
     pyautogui.keyDown('down')
     time.sleep(2)
     pyautogui.keyUp('down')
     pyautogui.press('p')
     if recipe.com == 's':
         pyautogui.press(recipe.com)
     pyautogui.press('enter')
开发者ID:technicallytexan,项目名称:COOKSERVE_BOT,代码行数:8,代码来源:recipes.py


示例12: Tu_Dong_Go_Phim

def Tu_Dong_Go_Phim():
    time.sleep(2)
    i = 0
    while i < 10:
        i += 1
        keyDown('enter', pause=0.25)
        keyUp('enter', pause=0.25)
        typewrite(str(i), interval=0.5)
开发者ID:sonzzdq,项目名称:PythonBasic,代码行数:8,代码来源:Auto_Keyboard_For_Windows.py


示例13: close

def close():
    """
    this method presses alt+f4 of the virtual key board.
    """
    p.keyDown('alt')
    p.keyDown('f4')
    p.keyUp('f4')
    p.keyUp('alt')
开发者ID:girish946,项目名称:SG-remote,代码行数:8,代码来源:commands.py


示例14: type_this

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)
开发者ID:jjvilm,项目名称:osrmacro,代码行数:8,代码来源:Keyboard.py


示例15: cut

def cut():
    """
    this method presses ctrl+x of the virtual key board.
    """
    p.keyDown('ctrl')
    p.keyDown('x')
    p.keyUp('x')
    p.keyUp('ctrl')
    notify('cut '+ clipboard.paste())
开发者ID:girish946,项目名称:SG-remote,代码行数:9,代码来源:commands.py


示例16: paste

def paste():
    """
    this method presses ctrl+v of the virtual key board.
    """
    p.keyDown('ctrl')
    p.keyDown('v')
    p.keyUp('v')
    p.keyUp('ctrl')
    notify('paste '+ clipboard.paste())
开发者ID:girish946,项目名称:SG-remote,代码行数:9,代码来源:commands.py


示例17: copy

def copy():
    """
    this method presses ctrl+c of the virtual key board.
    """
    p.keyDown('ctrl')
    p.keyDown('c')
    p.keyUp('c')
    p.keyUp('ctrl')
    notify('copy '+ clipboard.paste())
开发者ID:girish946,项目名称:SG-remote,代码行数:9,代码来源:commands.py


示例18: 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


示例19: click_through

def click_through(i):
    ad_spotter(i)
    #for i in range(0,3):
    #    pyautogui.click()
    time.sleep(2)
    #pyautogui.click()
    #close_tab()
    pyautogui.keyDown('command')
    pyautogui.press('w')
    pyautogui.keyUp('command')
开发者ID:erickstm87,项目名称:url_opener,代码行数:10,代码来源:browser_easi.py


示例20: key_down

 def key_down(self, key, down_tm: float):
     """
     Custom sleep time for when a key needs to be
     held down for a cooking recipe
     :param down_tm: sleep time
     """
     pyautogui.keyDown(key, _pause=False)
     time.sleep(down_tm)
     pyautogui.keyUp(key, _pause=False)
     time.sleep(self.key_press_sleep)
开发者ID:pydo,项目名称:cookServeDelicious-Bot,代码行数:10,代码来源:async_recipe.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python pyautogui.locateOnScreen函数代码示例发布时间:2022-05-25
下一篇:
Python pyautogui.keyDown函数代码示例发布时间: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