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:
@@ -302,7 +302,12 @@ class MacroManager:
|
|||||||
# Press key combination
|
# Press key combination
|
||||||
keys = cmd.get("keys", [])
|
keys = cmd.get("keys", [])
|
||||||
if 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":
|
elif cmd_type == "wait":
|
||||||
# Delay in milliseconds
|
# Delay in milliseconds
|
||||||
|
|||||||
Reference in New Issue
Block a user