Trackpad scrolling?

Hello all!

In macOS builds, is there a way to enable scrolling ScrollView widgets with two-finger trackpad scrolling, as is standard on Mac laptops?

I have a ScrollView widget in my app (set to only scroll vertically). Right now the only way to scroll it on macOS builds is to click-and-drag, which feels heavy / friction-y / non-intuitive for modern Mac laptops.

Thanks in advance!

Bump?

The widget libraries are open source so you can make this change yourself.  It is all pure lua code.

You would need to track multiple touches and their relative velocities and translate that into scrolling.

I had to modify the scrollView to fit how I wanted it to function.

Thanks for the reply, SGS!

Alas, I’m not sure I follow your answer. Here’s where I get confused:

  • On a Mac laptop, you can scroll any window just by dragging two fingers on the trackpad (as long as the mouse cursor is over that window).

  • But I don’t think any of that registers as touch/tap events on the Corona side. There’s no “click” of the trackpad’s mouse-button involved.

Am I not understanding this correctly?

Is there documentation anywhere for how to do this?

Thanks in advance…

— KB

This is not just Macs, Windows laptops have been doing this for years.

You can access the source code here for the widget libary - https://github.com/coronalabs/framework-widget/tree/master/widgetLibrary

I am not sure how/if touch pads would work, but you can definitely do this for touchscreens. 

Maybe this will need to be something Corona need to provide?

Thanks for the followup.

I just found some more info here…

https://forums.coronalabs.com/topic/69797-widgets-dont-react-to-trackpad-gestures-on-mac-os/

… and found there’s an existing feature request, which I voted up.

Have you tried this https://marketplace.coronalabs.com/corona-plugins/mac-trackpad?

Might work for you.

Alas, that only handles rotate, pinch, and pressure gestures.

But I appreciate your wanting to be of service! You have earned some good karma today.

Bump?

The widget libraries are open source so you can make this change yourself.  It is all pure lua code.

You would need to track multiple touches and their relative velocities and translate that into scrolling.

I had to modify the scrollView to fit how I wanted it to function.

Thanks for the reply, SGS!

Alas, I’m not sure I follow your answer. Here’s where I get confused:

  • On a Mac laptop, you can scroll any window just by dragging two fingers on the trackpad (as long as the mouse cursor is over that window).

  • But I don’t think any of that registers as touch/tap events on the Corona side. There’s no “click” of the trackpad’s mouse-button involved.

Am I not understanding this correctly?

Is there documentation anywhere for how to do this?

Thanks in advance…

— KB

This is not just Macs, Windows laptops have been doing this for years.

You can access the source code here for the widget libary - https://github.com/coronalabs/framework-widget/tree/master/widgetLibrary

I am not sure how/if touch pads would work, but you can definitely do this for touchscreens. 

Maybe this will need to be something Corona need to provide?

Thanks for the followup.

I just found some more info here…

https://forums.coronalabs.com/topic/69797-widgets-dont-react-to-trackpad-gestures-on-mac-os/

… and found there’s an existing feature request, which I voted up.

Have you tried this https://marketplace.coronalabs.com/corona-plugins/mac-trackpad?

Might work for you.

Alas, that only handles rotate, pinch, and pressure gestures.

But I appreciate your wanting to be of service! You have earned some good karma today.