pyautogui's Quartz-based keystroke path often fails on newer macOS because the Python CLI binary doesn't auto-surface in System Settings > Accessibility. User reported the daemon detected taps fine but keystrokes never landed in any window. Switch to AppleScript / System Events on macOS. Permission attaches to whatever terminal/app launched the Python process (Terminal.app, iTerm, etc.) — a familiar named app the user can grant Accessibility to in one click. Combined keystroke + Return in a single osascript call to keep latency ~100ms per tap. Fall back to pyautogui if osascript fails (handles edge cases) and on non-macOS platforms.
7.8 KiB
7.8 KiB