fix: hotkey parsing and initialization order
- Use pynput format <f12>, <shift>+<f12> etc for hotkey parsing - Initialize screenshot hotkeys AFTER UI setup (fixes log_output error) - Clean up hotkey display in help text (remove angle brackets)
This commit is contained in:
parent
299b1e0fa5
commit
21c2508842
|
|
@ -46,10 +46,10 @@ class ScreenshotHotkeyManager(QObject):
|
|||
|
||||
# Default hotkeys
|
||||
DEFAULT_HOTKEYS = {
|
||||
'screenshot_full': 'f12', # Full screen
|
||||
'screenshot_region': 'shift+f12', # Region selection
|
||||
'screenshot_loot': 'ctrl+f12', # Loot window area
|
||||
'screenshot_hud': 'alt+f12', # HUD area
|
||||
'screenshot_full': '<f12>', # Full screen
|
||||
'screenshot_region': '<shift>+<f12>', # Region selection
|
||||
'screenshot_loot': '<ctrl>+<f12>', # Loot window area
|
||||
'screenshot_hud': '<alt>+<f12>', # HUD area
|
||||
}
|
||||
|
||||
def __init__(self, screenshot_manager: Optional[AutoScreenshot] = None,
|
||||
|
|
@ -360,7 +360,9 @@ class ScreenshotHotkeyManager(QObject):
|
|||
|
||||
for action, combo in self.hotkeys.items():
|
||||
desc = descriptions.get(action, action)
|
||||
lines.append(f" {combo.upper():<15} - {desc}")
|
||||
# Remove angle brackets for display
|
||||
display_combo = combo.replace('<', '').replace('>', '')
|
||||
lines.append(f" {display_combo.upper():<15} - {desc}")
|
||||
|
||||
return "\n".join(lines)
|
||||
|
||||
|
|
|
|||
|
|
@ -412,8 +412,8 @@ class MainWindow(QMainWindow):
|
|||
self._screenshot_capture = ScreenshotCapture(self.db)
|
||||
|
||||
# Screenshot hotkey manager (global hotkeys for manual capture)
|
||||
# Note: Initialized after UI setup because it uses log_output
|
||||
self._screenshot_hotkeys = None
|
||||
self._init_screenshot_hotkeys()
|
||||
|
||||
# Setup UI
|
||||
self.setup_ui()
|
||||
|
|
@ -421,6 +421,9 @@ class MainWindow(QMainWindow):
|
|||
self.create_menu_bar()
|
||||
self.create_status_bar()
|
||||
|
||||
# Initialize screenshot hotkeys AFTER UI is setup
|
||||
self._init_screenshot_hotkeys()
|
||||
|
||||
# Load persistent settings
|
||||
self._load_settings()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue