本文整理汇总了Python中pyautogui.keyUp函数的典型用法代码示例。如果您正苦于以下问题:Python keyUp函数的具体用法?Python keyUp怎么用?Python keyUp使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了keyUp函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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)
示例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")
示例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')
示例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
示例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
示例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)
示例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
示例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
示例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
示例10: startup_menu
def startup_menu():
"""
this method shows the startup menu....
"""
p.keyDown('alt')
p.keyDown('f1')
p.keyUp('f1')
p.keyUp('alt')
示例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')
示例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)
示例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')
示例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)
示例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())