Trackpad gestures!

We’re releasing support for trackpad gestures. This enables easy and intuitive game controls on supported laptops.

This enables the user to fully control the camera without having to hold down the right mouse button:

  • 1 finger = cursor
  • 2 fingers together = camera control
  • 2 fingers pinch in/out = camera zoom

Technical details

Gestures are exposed by a new event, PointerAction.

Signature:

UserInputService.PointerAction(float wheel, Vector2 pan, float pinch, bool gameProcessedEvent).

Parameters:

  • float wheel: Discrete wheel input from a physical mouse.
  • Vector2 pan: Horizontal and vertical two-finger pan on a trackpad.
  • float pinch: Pinch gesture on a trackpad.
  • bool gameProcessedEvent: Determines if the engine has processed the input (ie has a gui with Active=true swallowed the event).

Briefly, arguments from PointerAction are combined additively into user actions. Zooming in 3D space is calculated as wheel + pinch, and 2D vertical scrolling is calculated as wheel + pan.Y.
You can inspect the source of the Roblox CameraScript to find a usage example.

Compatibility & next steps

  • Gestures are fully supported on MacOS.
  • We are actively working on support for Windows machines, as well as a fallback control scheme for systems lacking supported hardware.
  • Due to technical limitations, Roblox Studio does not support trackpad gestures.

Timeline

We’ll attempt to turn this feature on next Wednesday (9/11/2019). If all goes well it will stay on.


You must have an up-to-date copy of the PlayerScripts for full gesture support.

If you don’t fork the PlayerScripts, you don’t have to do anything – your game will magically support trackpad gestures after next week.

Old, forked copies of the PlayerScript used the now-legacy MouseWheel input event. These must be migrated to the new PointerAction API for full gesture support.

Don’t be afraid to pop me a DM if you need help integrating PointerActions into your custom camera controller.

214 Likes

I’m sorry… what? So your saying a laptop users dream is coming true, that’s what your saying right?

omg omg omg omg thank you.

50 Likes

Thank you, thank you, thank you! As someone who spends a lot of time away from my house this makes things so much easier!

21 Likes

Do PointerActions mean smooth scrolling support soon? :open_mouth:

18 Likes

Smooth scrolling is live.

18 Likes

Wow! It’s great to see improved support for laptops to allow for greater accessibility!

11 Likes

I think that’s what their saying!

8 Likes

Nice update! I really like it, now I don’t need to press “i” and “o”

7 Likes

Not quite what I meant - as in, for scrolling frames and such. I’m assuming the new PointerAction system would make this possible in future without breaking compatibility with some older games?

2 Likes

Yay! Going to update my SmoothScroll module to support this when I have a chance.

Thank you for giving us more control over user input!

EDIT:
Added trackpad support and actually fixed other issues. SmoothScroll is finally complete!

3 Likes

If they do add that, then mouse users will be the only ones left with choppy ScrollingFrames.

I hope they eventually add it for everyone, making my module obsolete!

3 Likes

Correct me if I’m wrong, wasn’t the two fingers to move the camera position around released a long time ago? I normally use a trackpad and that’s how I’ve been doing it. It doesn’t work on Windows, but it’s been like that for a while on Macbook.

4 Likes

There’s a fix for choppy scrollingframes? Could you link me it? o.o

3 Likes

Yeah, I wrote a module for it. It has minor downsides, read the thread for details!

4 Likes

Great update, this would allow developers to create new UI functionality (e.g. panning and zooming on a map). Does the future Windows support require precision touchpad compatible drivers? (first seen in Windows 8 I think)

2 Likes

Thank you for saving us with this update! Now we won’t have to worry about right button then move the trackpad, wayback in the days. Thank you Roblox!

3 Likes

Omg, my dream comed true, I am alot not home and I use my laptop, thank you very much!

1 Like

Zooming always worked anyway? but great to see more gestures being added :grin:

4 Likes

This is nice. Although I have played ROBLOX on laptop for a while, the next time I do it will be much easier! :smiley:

1 Like

i had this for years already on mac? is this for windows or what? the only thing new here is 2 fingers together is for camera look around

3 Likes