Refine pause/resume behavior handling
This commit is contained in:
parent
e3e3d3b914
commit
a8603d4d45
6
main.py
6
main.py
@ -105,16 +105,14 @@ def handle_f8():
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"Error sending pause command (F8): {e}")
|
print(f"Error sending pause command (F8): {e}")
|
||||||
else:
|
else:
|
||||||
print("\n--- F8 pressed: Resuming script, resetting state, and resuming UI monitoring ---")
|
print("\n--- F8 pressed: Resuming script and UI monitoring ---")
|
||||||
reset_command = {'action': 'reset_state'}
|
|
||||||
resume_command = {'action': 'resume'}
|
resume_command = {'action': 'resume'}
|
||||||
try:
|
try:
|
||||||
main_loop.call_soon_threadsafe(command_queue.put_nowait, reset_command)
|
|
||||||
# Add a small delay? Let's try without first.
|
# Add a small delay? Let's try without first.
|
||||||
# time.sleep(0.05) # Short delay between commands if needed
|
# time.sleep(0.05) # Short delay between commands if needed
|
||||||
main_loop.call_soon_threadsafe(command_queue.put_nowait, resume_command)
|
main_loop.call_soon_threadsafe(command_queue.put_nowait, resume_command)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"Error sending reset/resume commands (F8): {e}")
|
print(f"Error sending resume command (F8): {e}")
|
||||||
|
|
||||||
def handle_f9():
|
def handle_f9():
|
||||||
"""Handles F9 press: Initiates script shutdown."""
|
"""Handles F9 press: Initiates script shutdown."""
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user