Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def typeThreeKeys(key1, key2, key3):
"""
@brief type three keys at the same time (key1 -> key2 -> key3)
"""
# wait before every operation
time.sleep(DELAY_KEY)
# type two keys at the same time
pyautogui.hotkey(key1, key2, key3)
return
pyautogui.press(arg)
s.sendall('[+]Injected pressed key' + End)
elif injection_type == 'sh':
if not arg:
s.sendall('[-]Supply a key as an arg'+End)
return
if ' ' in arg:
arg = arg.split(' ')
for key in arg:
pyautogui.keyDown(key)
for key in reversed(arg):
pyautogui.keyUp(key)
s.sendall('[+]Injected keyboard shortcut' + End)
else:
pyautogui.hotkey(arg)
s.sendall('[+]Injected keyboard shortcut' + End)
elif injection_type == 'valids':
tar_list = '|/'.join(valid_keys)
s.sendall(tar_list + End)
elif injection_type == 'click_left':
pyautogui.click(button='left')
s.sendall('[+]Injected left mouse click' + End)
elif injection_type == 'click_right':
pyautogui.click(button='right')
s.sendall('[+]Injected right mouse click' + End)
elif injection_type == 'move_to':
if not arg:
s.sendall('[-]Supply a key as an arg'+End)
return
try:
arg = arg.split(' ')
def throw_bait(self, fishing_hotkey):
pyautogui.hotkey(fishing_hotkey)
def throw_bait(self, fishing_hotkey):
pyautogui.hotkey(fishing_hotkey)
def handle_paste_intent(self, message):
self.speak("Pasting from clipboard")
pyautogui.hotkey("ctrl", "v")
def handle_cut_intent(self, message):
self.speak("Cutting to clipboard")
pyautogui.hotkey("ctrl", "x")
def prev_window(x = None):
gui.hotkey('altleft', 'shiftleft', 'tab')
pdfWriter.write(pdfOutputFile)
pdfOutputFile.close()
pdf1File.close()
pdf2File.close()
os.remove(filedir + 'Ebook.pdf')
os.remove(filedir + 'File2.pdf')
os.rename(filedir + 'Ebook1.pdf', filedir + 'Ebook.pdf')
print("Page: " + str(page + 2) + ' of ' + str(len(RomanBookList)))
print("\nRoman Numerals Done\n")
pyautogui.hotkey('ctrl', 'pagedown', interval = 0.25)
else:
PageEntry1 = NumberList[0]
PageEntry2 = NumberList[1]
pyautogui.hotkey('ctrl', 'p')
pyautogui.press(keys = 'tab', presses = 2, interval = 0.25)
pyautogui.press('delete', 5)
pyautogui.typewrite(PageEntry1)
pyautogui.press('tab')
pyautogui.press('delete', 5)
pyautogui.typewrite(PageEntry2)
pyautogui.typewrite(['tab', 'tab', 'enter', 'enter'], interval = 0.25 )
pyautogui.typewrite("Ebook", interval = 0.50)
pyautogui.press('enter', interval = 0.5)
time.sleep(0.25)
def NumberProcess(start, inputLastPageList):
for page in range(start, len(NumberList), 2):
pyautogui.hotkey('ctrl', 'p', interval = 0.25)
pyautogui.press('tab', 2, interval = 0.25)
pyautogui.press('delete', 5, interval = 0.25)