Skip to content

✨ Better mouse handling#897

Merged
SenpaiHunters merged 6 commits into
developfrom
better-mouse-handling
Nov 23, 2025
Merged

✨ Better mouse handling#897
SenpaiHunters merged 6 commits into
developfrom
better-mouse-handling

Conversation

@mrkai77
Copy link
Copy Markdown
Owner

@mrkai77 mrkai77 commented Nov 23, 2025

  • Added a new MouseInteractionObserver class that tracks mouse movement and clicks while Loop is active.
  • Radial menu window actions are now stored in an array rather than mapped by direction. This allows new radial menu actions to be added simply by appending to the array, forming part of the upcoming radial-menu customization features.
  • Introduced a new window-action enum for the radial menu: RadialMenuWindowAction, with two cases: custom, which defines an entirely new action, and keybindReference, which links to one of the user’s existing keybinds by UUID. This also supports radial-menu customization.
  • Updated WindowActionCache to include an additional dictionary that can store window actions by either keybind or identifier, speeding up the ID -> action lookup path.

@mrkai77 mrkai77 requested a review from Copilot November 23, 2025 03:00
@mrkai77 mrkai77 self-assigned this Nov 23, 2025
@mrkai77 mrkai77 linked an issue Nov 23, 2025 that may be closed by this pull request
4 tasks
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors mouse handling in Loop by extracting mouse interaction logic into a dedicated observer class and consolidating radial menu actions into a unified configuration system.

Key Changes:

  • Introduced MouseInteractionObserver to encapsulate mouse event handling previously spread across LoopManager
  • Refactored radial menu actions from individual Defaults keys to a single unified radialMenuActions array using RadialMenuWindowAction enum
  • Renamed observer classes from *Observer to *Trigger for clarity, and introduced helper classes TriggerDelayTimer and DoubleClickTimer

Reviewed changes

Copilot reviewed 12 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
Loop/Extensions/Logger+Extensions.swift Added convenience initializer for Logger to simplify category-based logging
Loop/Extensions/Defaults+Extensions.swift Consolidated keybind and radial menu defaults to use centralized static properties instead of inline definitions
Loop/Core/WindowDragManager.swift Added @mainactor annotation to addObservers method for thread safety
Loop/Core/Observers/MouseInteractionObserver.swift New class to handle mouse interactions including radial menu navigation and cycle actions
Loop/Core/Observers/MiddleClickTrigger.swift Renamed from MiddleClickObserver for consistency
Loop/Core/Observers/KeybindTrigger.swift Renamed from KeybindObserver, refactored to use shared WindowActionCache
Loop/Core/Observers/Helpers/TriggerDelayTimer.swift New utility class for managing trigger delay timer logic
Loop/Core/Observers/Helpers/DoubleClickTimer.swift New utility class for detecting double-click events
Loop/Core/LoopManager.swift Major refactoring to delegate mouse handling to MouseInteractionObserver and use renamed trigger classes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Loop/Core/Observers/MouseInteractionObserver.swift Outdated
Comment thread Loop/Core/Observers/MouseInteractionObserver.swift Outdated
@SenpaiHunters SenpaiHunters merged commit fbb6a7e into develop Nov 23, 2025
1 check passed
@SenpaiHunters SenpaiHunters deleted the better-mouse-handling branch November 23, 2025 05:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐞 Disable cursor interaction ignored in 1.4.0

3 participants