Skip to content

fix: trackpad scrolling within viewport not working - #355

Open
kenmcgaugh wants to merge 2 commits into
AcademySoftwareFoundation:developfrom
kenmcgaugh:pr_viewport_trackpad
Open

kenmcgaugh wants to merge 2 commits into
AcademySoftwareFoundation:developfrom
kenmcgaugh:pr_viewport_trackpad

Conversation

@kenmcgaugh

Copy link
Copy Markdown
Contributor

Using trackpad scroll gestures wasn't working in the viewport due to 2 issues. First, the Qt wheel events were being sent to xstudio using the device type as the input type signature even though xstudio only handles those with an event type signature of Signature::InputType::Mouse. So this fix hard-codes that input type signature for all wheel events. Perhaps a more proper solution would be to add support on the xstudio side for events from different input types.

The next issue was in the following line:

anon_mail(playhead::step_atom_v, event->angleDelta().ry() > 0 ? 1 : -1)

When using a trackpad under macOS, the event's angleDelta() can be zero since the delta comes through the pixelData() instead. And the conditional would return -1 in that case, causing the scrubbing to be almost exclusively backwards.

Note this has only been tested under macOS. It would be great if someone could test this on a windows laptop and also to test it doesn't break other device inputs (like wacom tablets).

kenmcgaugh and others added 2 commits October 14, 2026 22:14
Using trackpad scroll gestures wasn't working in the viewport due to 2 issues. First, the Qt wheel events were being sent to xstudio using the device type as the input type signature even though xstudio only handles those with an event type signature of Signature::InputType::Mouse. So this fix hard-codes that input type signature for all wheel events. Perhaps a more proper solution would be to add support on the xstudio side for events from different input types.

The next issue was in the following line:

    anon_mail(playhead::step_atom_v, event->angleDelta().ry() > 0 ? 1 : -1)

When using a trackpad under macOS, the event's angleDelta() can be zero since the delta comes through the pixelData() instead. And the conditional would return -1 in that case, causing the scrubbing to be almost exclusively backwards.

Signed-off-by: Ken McGaugh <ken@mcgaugh.co.uk>
@richardssam

Copy link
Copy Markdown
Contributor

Just a note to say, this is working great for me. Thanks for pushing it Ken!

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.

3 participants