Fix hotkey execution reliability on Windows

- Add interval parameter (50ms) between key presses in pyautogui.hotkey()
- Add small delay before hotkey execution for better Windows compatibility
- Add defensive check to handle keys stored as string instead of list

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-04 12:18:17 -08:00
parent c9d0c9812d
commit 517ee943a9

View File

@@ -302,7 +302,12 @@ class MacroManager:
# Press key combination
keys = cmd.get("keys", [])
if keys:
pyautogui.hotkey(*keys)
# Ensure keys is a list, not a string
if isinstance(keys, str):
keys = [k.strip().lower() for k in keys.split(",")]
# Small delay before hotkey for reliability on Windows
time.sleep(0.05)
pyautogui.hotkey(*keys, interval=0.05)
elif cmd_type == "wait":
# Delay in milliseconds