Compare commits

...

2 Commits

View File

@ -45,10 +45,11 @@ def perform_ocr(screenshot: bytes) -> list[dict]:
for i in range(n): for i in range(n):
text = data['text'][i] text = data['text'][i]
if text and text.strip(): if text and text.strip():
# Fix the center-point calculation (add first, then divide)
results.append({ results.append({
'text': text, 'text': text,
'x': data['width'][i] + data['left'][i] // 2, # center x position 'x': data['left'][i] + data['width'][i] // 2,
'y': data['height'][i] + data['top'][i] // 2 # center y position 'y': data['top'][i] + data['height'][i] // 2
}) })
# check if debug is enabled # check if debug is enabled
@ -109,7 +110,7 @@ def wait(duration: float) -> None:
def search_pc(query: str) -> None: def search_pc(query: str) -> None:
"""Presses the Windows key.""" """Presses the Windows key."""
pyautogui.hotkey('win') pyautogui.hotkey('win')
wait(2) wait(4)
press_keyboard(KeyboardInput(text=query)) press_keyboard(KeyboardInput(text=query))
def reprompt(nextsteps: str, processor) -> None: def reprompt(nextsteps: str, processor) -> None: