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
|
||||||
DEFAULT_HOTKEYS = {
|
DEFAULT_HOTKEYS = {
|
||||||
'screenshot_full': 'f12', # Full screen
|
'screenshot_full': '<f12>', # Full screen
|
||||||
'screenshot_region': 'shift+f12', # Region selection
|
'screenshot_region': '<shift>+<f12>', # Region selection
|
||||||
'screenshot_loot': 'ctrl+f12', # Loot window area
|
'screenshot_loot': '<ctrl>+<f12>', # Loot window area
|
||||||
'screenshot_hud': 'alt+f12', # HUD area
|
'screenshot_hud': '<alt>+<f12>', # HUD area
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, screenshot_manager: Optional[AutoScreenshot] = None,
|
def __init__(self, screenshot_manager: Optional[AutoScreenshot] = None,
|
||||||
|
|
@ -360,7 +360,9 @@ class ScreenshotHotkeyManager(QObject):
|
||||||
|
|
||||||
for action, combo in self.hotkeys.items():
|
for action, combo in self.hotkeys.items():
|
||||||
desc = descriptions.get(action, action)
|
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)
|
return "\n".join(lines)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -412,14 +412,17 @@ class MainWindow(QMainWindow):
|
||||||
self._screenshot_capture = ScreenshotCapture(self.db)
|
self._screenshot_capture = ScreenshotCapture(self.db)
|
||||||
|
|
||||||
# Screenshot hotkey manager (global hotkeys for manual capture)
|
# Screenshot hotkey manager (global hotkeys for manual capture)
|
||||||
|
# Note: Initialized after UI setup because it uses log_output
|
||||||
self._screenshot_hotkeys = None
|
self._screenshot_hotkeys = None
|
||||||
self._init_screenshot_hotkeys()
|
|
||||||
|
|
||||||
# Setup UI
|
# Setup UI
|
||||||
self.setup_ui()
|
self.setup_ui()
|
||||||
self.apply_dark_theme()
|
self.apply_dark_theme()
|
||||||
self.create_menu_bar()
|
self.create_menu_bar()
|
||||||
self.create_status_bar()
|
self.create_status_bar()
|
||||||
|
|
||||||
|
# Initialize screenshot hotkeys AFTER UI is setup
|
||||||
|
self._init_screenshot_hotkeys()
|
||||||
|
|
||||||
# Load persistent settings
|
# Load persistent settings
|
||||||
self._load_settings()
|
self._load_settings()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue