Repository navigation
Auto Scroll triggered by a Logitech button starts at the cursor - #1480
Conversation
Logitech control events report the cursor in global display coordinates (top-left origin), while Auto Scroll measures pointer travel with unflippedLocation (bottom-left origin of the main display). The anchor and the following pointer events disagreed vertically, so the indicator showed up mirrored and the slightest movement scrolled fast or skipped the dead zone. Convert the Logitech location before using it as the anchor. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Convert and use the Logitech pointer location LinearMouse/EventTransformer/AutoScrollTransformer.swift, LinearMouseUnitTests/EventTransformer/AutoScrollTransformerTests.swift |
A helper converts the Logitech context location using the main display height. Long-press, hold-only, and immediate activation use the converted location. A test checks that a small move does not activate autoscroll and a larger vertical move does. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Merge Risk: 
Minimal · up to 795bd
-
Logitech-triggered Auto Scroll now uses the same coordinate space as pointer movement. No material merge-blocking risk was identified.
Pre-merge checks: 
4
Finishing Touches
-
Generate docstrings
-
- Commit to this branch
- Create a new PR
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Summary
When Auto Scroll is triggered by a Logitech control (a button diverted over HID++, such as the MX Master gesture or thumb button), the anchor was placed at the wrong vertical position:
The closer the cursor was to the vertical center of the main display, the less noticeable it was. Middle-button triggers were not affected.
Cause
LogitechEventContext.mouseLocationcomes fromCGEvent(source: nil).location, which uses global display coordinates with a top-left origin. Auto Scroll measures pointer travel withCGEvent.unflippedLocation, whose origin is the bottom-left of the main display. The anchor and the following pointer events were therefore in different coordinate spaces.Fix
Convert the Logitech location into the
unflippedLocationspace before using it as the anchor for pending and immediate activations.Testing
testLogitechHoldAnchorsAtTheCursorPosition: a 2pt move after a Logitech press stays inside the dead zone, and a 20pt move activates Auto Scroll. It fails without this fix.🤖 Generated with Claude Code