def pressHoldRelease(*args):
'''
press and hold passed in strings. Once held, release
accepts as many arguments as you want.
e.g. pressAndHold('left_arrow', 'a','b').
this is useful for issuing shortcut command or shift commands.
e.g. pressHoldRelease('ctrl', 'alt', 'del'), pressHoldRelease('shift','a')
'''
for i in args:
win32api.keybd_event(VK_CODE[i], 0, 0, 0)
time.sleep(.05)
for i in args:
win32api.keybd_event(VK_CODE[i], 0, win32con.KEYEVENTF_KEYUP, 0)
time.sleep(.1)
评论列表
文章目录