|
|
|
@ -311,16 +311,32 @@ def SystemCMDRun(inSessionHexStr, inCMDCommandStr = "echo 1", inModeStr="CROSSCH
|
|
|
|
|
while lRecoveryWindowRUNRetryIteratorInt<gRecoveryWindowRUNRetryCountInt: # loop for retry
|
|
|
|
|
lCMDPostFixStr = "" # Case default "RUN"
|
|
|
|
|
if inModeStr == "CROSSCHECK":
|
|
|
|
|
lCMDPostFixStr = f"& (echo {lCrosscheckKeyStr} | clip)"
|
|
|
|
|
#lCMDPostFixStr = f"& (echo {lCrosscheckKeyStr} | clip)"
|
|
|
|
|
lCMDPostFixStr = f"| (echo {lCrosscheckKeyStr} | clip)" # Bugfix async set clipboard data
|
|
|
|
|
elif inModeStr == "LISTEN":
|
|
|
|
|
lCMDPostFixStr = f"| clip"
|
|
|
|
|
Clipboard.TextSet("") # Clear the clipboard
|
|
|
|
|
KeyboardHotkey("win","r") # win+r
|
|
|
|
|
time.sleep(gKeyboardHotkeyDelaySecFloat)
|
|
|
|
|
KeyboardHotkey("ctrl","a") # Select all
|
|
|
|
|
KeyboardHotkey("ctrl","a") # Select all Bugfix - need double ctrl A because some OS reset selestion when ctrl A in RUN window
|
|
|
|
|
#time.sleep(gKeyboardHotkeyDelaySecFloat)
|
|
|
|
|
keyboard.send("backspace") # Delete selected all
|
|
|
|
|
time.sleep(gKeyboardHotkeyDelaySecFloat) # Wait for RUN window will appear ctrl+a+backspace is async - so we need some timeout...
|
|
|
|
|
lInputStr = f"cmd /c ({inCMDCommandStr}) {lCMDPostFixStr}" # Generate the output string for RUN window
|
|
|
|
|
keyboard.write(lInputStr) # Write new text
|
|
|
|
|
time.sleep(gKeyboardHotkeyDelaySecFloat)
|
|
|
|
|
# Check if autocomplete
|
|
|
|
|
# # # # # # #
|
|
|
|
|
KeyboardHotkey("ctrl", "c") # Copy data
|
|
|
|
|
# Check the clipboard
|
|
|
|
|
lClipboardStr = Clipboard.TextGet() # Get text from clipboard
|
|
|
|
|
time.sleep(gKeyboardHotkeyDelaySecFloat)
|
|
|
|
|
#lL.debug(f"Clipboard text when check autocomplete:'{lClipboardStr}'")
|
|
|
|
|
if lClipboardStr != "": # Send backspace if
|
|
|
|
|
time.sleep(gKeyboardHotkeyDelaySecFloat)
|
|
|
|
|
keyboard.send("backspace") # Delete selected all
|
|
|
|
|
# # # # # # # #
|
|
|
|
|
KeyboardHotkey("ctrl","a") # Select all
|
|
|
|
|
KeyboardHotkey("ctrl","c") # Copy data
|
|
|
|
|
# Check the clipboard
|
|
|
|
|