Skip to content

Preserve fractional GCMouse scroll deltas - #97

Merged
SandiyosDev merged 3 commits into
hugeBlack:mainfrom
alantangok:alan/fix/ipad-scroll
Oct 17, 2026
Merged

SandiyosDev merged 3 commits into
hugeBlack:mainfrom
alantangok:alan/fix/ipad-scroll

Conversation

@alantangok

@alantangok alantangok commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

GameController scroll callbacks currently convert each Float delta directly to Int32, so sub-tick movements are discarded. This PR retains the fractional remainder between callbacks and emits whole wheel ticks as they accumulate.

  • Keep a separate remainder for each mouse and scroll axis, scoped to its registered callback.
  • Preserve the existing axis mapping and the sign and magnitude of integer wheel deltas.
  • Limit the change to GameController.swift. The earlier setting/UI, UIKit scroll recognizer, source-selection policy, and sensitivity changes have been removed.
  • Existing settings and defaults are unchanged; no synthetic momentum is added.

Verification

  • A temporary Swift harness executes the actual registered scroll callbacks with test doubles: 18 assertions pass for positive/negative fractional input, integer direction and magnitude, interleaved axes, direction changes, independent mice, and replacement mouse registration.
  • Unsigned Release iOS device build succeeded.
  • Xcode Release static analysis succeeded.
  • git diff --check passed.
  • GitHub Actions archive and IPA packaging passed: https://github.com/hugeBlack/OpenParsec/actions/runs/38893496994.

Device validation

Physical Magic Keyboard trackpad testing was reported on 2026-10-16 using an iPad Air (5th generation, iPad13,17), iPadOS 26.6 (23G71), and OpenParsec 1.4.0 build 223 (main + this PR). The tester reported that the previous jumpy/skipping behavior appeared resolved.

The existing scroll sensitivity and reverse-direction controls still had no effect on the GCMouse path in build 223. A separate local settings-only follow-up (build 224) was tested and the tester confirmed that issue was fixed; that follow-up is not included in this PR.

There is separate device feedback about scroll acceleration/velocity response during a gesture and inertial deceleration after release. Those are distinct from fractional accumulation and are not part of this PR. Discrete mouse-wheel validation is still pending.

Addresses the scope feedback in #97 (comment).

@alantangok alantangok changed the title Fix iPad scroll momentum and natural direction Fix iPad scroll source and natural direction Sep 15, 2026
@SandiyosDev

Copy link
Copy Markdown
Collaborator

Ill only take the fractional accumulator on the GameController scroll, the rest I can't take, the momentum is in your first commit and gone in the second so the PR doesn't do what the title says

You default natural scrolling to on which flips the direction for everyone with a mouse the day they update, you need to consider the experience from the user's perspective, not just pump out lines... same with your other changes... If you can cut it down to the accumulator on the existing setting, I can merge it

@alantangok alantangok changed the title Fix iPad scroll source and natural direction Preserve fractional GCMouse scroll deltas Oct 16, 2026
@alantangok

Copy link
Copy Markdown
Contributor Author

Thanks @SandiyosDev for the feedback. I've narrowed this to fractional accumulation in the existing GCMouse callbacks, as requested.

The PR now changes only GameController.swift (+14/-2 relative to the base). The extra setting/UI, UIKit scroll source, source-selection policy, and sensitivity changes have been removed. Existing axis mapping, integer wheel direction/magnitude, and settings defaults are preserved. Each mouse and axis keeps its own fractional remainder.

Verification: 18 assertions pass in a temporary Swift harness executing the actual registered callbacks with test doubles; the unsigned Release iOS build, Release static analysis, and git diff --check also pass. Physical Magic Keyboard and discrete-wheel validation of this revision is still pending.

I appreciate the clear guidance on keeping this focused.

@alantangok

Copy link
Copy Markdown
Contributor Author

Device test update, keeping the scope guidance above in mind:

Test environment

  • iPad Air (5th generation), iPad13,17, 64 GB.
  • iPadOS 26.6 (23G71), read from the connected device and cross-checked with Xcode device information.
  • Magic Keyboard trackpad; OpenParsec 1.4.0 test builds 223 and 224.

Results

  • In build 223 (main + this PR), the previous jumpy/skipping scrolling appeared resolved.
  • Scroll sensitivity and Reverse Scroll Direction still had no effect on the GCMouse path. The reverse-setting symptom was also reported in #96.
  • A separate local build 224 applies those existing settings to both GCMouse callbacks before fractional accumulation. After testing it, I confirmed the settings issue was fixed. That follow-up passed 84 callback-harness assertions and a Release iOS build; it remains separate from this PR.

Remaining feel feedback, for separate discussion

The skipping is fixed, but the Magic Keyboard trackpad still feels different from touchscreen scrolling and the expected MacBook trackpad experience. There are two distinct aspects:

  1. Scroll acceleration / velocity response while moving: slow gestures should give fine control, while faster swipes should produce stronger scrolling. This is speed-dependent response, distinct from a fixed sensitivity multiplier.
  2. Inertial / momentum scrolling after release: touchscreen scrolling continues and gradually slows down, whereas the Magic Keyboard trackpad stops abruptly when finger input ends. A fast swipe should coast and decelerate smoothly.

Fractional accumulation addresses small deltas being discarded; acceleration and inertia are separate behaviors. Given the request to keep #97 limited to the accumulator, I am reporting these as separate user-experience feedback rather than adding them back to this PR.

Discrete mouse-wheel validation is still pending.

@SandiyosDev
SandiyosDev merged commit 4e68c6b into hugeBlack:main Oct 17, 2026
3 checks passed
@SandiyosDev

Copy link
Copy Markdown
Collaborator

thanks for cutting things down to the accumulator

@alantangok

Copy link
Copy Markdown
Contributor Author

thanks for the review and merge, @SandiyosDev!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants