Fix PyInstaller build issues and add right-click edit
## Fixes - Web interface now loads correctly in built app (use sys._MEIPASS for bundled web files) - Macro execution no longer locks up (use pyperclip clipboard for Unicode text support) - Right-click context menu works (use Qt signals instead of fragile parent traversal) ## Changes - web_server.py: Use get_resource_path() for web directory - macro_manager.py: Use clipboard paste for text commands instead of typewrite - gui/main_window.py: Add edit_requested/delete_requested signals to MacroButton - pyproject.toml: Add pyperclip dependency - All .spec files: Add pyperclip to hidden imports 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -275,13 +275,21 @@ class MacroManager:
|
||||
cmd_type = cmd.get("type", "")
|
||||
|
||||
if cmd_type == "text":
|
||||
# Type text string
|
||||
# Type text string using clipboard for Unicode support
|
||||
value = cmd.get("value", "")
|
||||
if value:
|
||||
if len(value) == 1:
|
||||
pyautogui.press(value)
|
||||
else:
|
||||
pyautogui.typewrite(value, interval=0.02)
|
||||
try:
|
||||
import pyperclip
|
||||
# Save current clipboard, paste text, restore (optional)
|
||||
pyperclip.copy(value)
|
||||
pyautogui.hotkey("ctrl", "v")
|
||||
time.sleep(0.05) # Small delay after paste
|
||||
except ImportError:
|
||||
# Fallback to typewrite for ASCII-only
|
||||
if len(value) == 1:
|
||||
pyautogui.press(value)
|
||||
else:
|
||||
pyautogui.typewrite(value, interval=0.02)
|
||||
|
||||
elif cmd_type == "key":
|
||||
# Press a single key
|
||||
|
||||
Reference in New Issue
Block a user