Make screen capture combo ignore paused status, make screen capture in general not affect the autopause timer

This commit is contained in:
AuroraWright
2025-07-06 04:27:57 +02:00
parent 325db373a4
commit 37bdfaf995
3 changed files with 5 additions and 6 deletions

View File

@@ -35,7 +35,7 @@ parser.add_argument('-d', '--delete_images', action='store_true', default=argpar
parser.add_argument('-n', '--notifications', action='store_true', default=argparse.SUPPRESS,
help='Show an operating system notification with the detected text. Will be ignored when reading with screen capture, unless screen_capture_combo is set.')
parser.add_argument('-a', '--auto_pause', type=float, default=argparse.SUPPRESS,
help='Automatically pause the program after the specified amount of seconds since the last successful text recognition. Will be ignored when reading with screen capture, unless screen_capture_combo is set. 0 to disable.')
help='Automatically pause the program after the specified amount of seconds since the last successful text recognition. Will be ignored when reading with screen capture. 0 to disable.')
parser.add_argument('-cp', '--combo_pause', type=str, default=argparse.SUPPRESS,
help='Combo to wait on for pausing the program. As an example: "<ctrl>+<shift>+p". The list of keys can be found here: https://pynput.readthedocs.io/en/latest/keyboard.html#pynput.keyboard.Key')
parser.add_argument('-cs', '--combo_engine_switch', type=str, default=argparse.SUPPRESS,

View File

@@ -772,12 +772,11 @@ def on_window_closed(alive):
def on_screenshot_combo():
if not paused:
screenshot_event.set()
screenshot_event.set()
def process_and_write_results(img_or_path, last_result, filtering, notify):
if auto_pause_handler:
if auto_pause_handler and not filtering:
auto_pause_handler.stop()
engine_instance = engine_instances[engine_index]
@@ -804,7 +803,7 @@ def process_and_write_results(img_or_path, last_result, filtering, notify):
with Path(write_to).open('a', encoding='utf-8') as f:
f.write(text + '\n')
if auto_pause_handler and not paused:
if auto_pause_handler and not paused and not filtering:
auto_pause_handler.start()
else:
logger.opt(ansi=True).info(f'<{engine_color}>{engine_instance.readable_name}</{engine_color}> reported an error after {end_time - start_time:0.03f}s: {text}')