Touchscreen and trackpad interactions

Interaction with 2D and 3D views using touchscreen and MacOS trackpad is now included in the latest nightly release.

If anyone has a chance to try them and would like to give feedback or suggestions, it would be appreciated.

2 Likes

@sunderlandkyl This works really well, thank you! Could you describe the list of new gestures supported? If you describe it here then I’ll add it to the user interface documentation.

Note for Mac users: Mac touchpad gestures are shown from 0:39.

I could not get it working on a touchpad on Linux. I used both Slicer nightly from your repository, and Slicer home built with unaltered code. The build machine has Qt 5.12.4, and the work laptop has Qt 5.13.0.

Commit 8f4af3d7596 states ‘If slice intersection is visible’. Even when slice intersection is visible, with any combination of crosshair, I could not get ‘rotate’ to work on a touchpad. I don’t have a touchscreen to test.

Can you elaborate on exact steps to follow ? Thanks.

The list of supported gestures are:

Windows

Touchscreen

  • 3D View:

    • Pinch (2 finger pinch): Zoom the camera in and out at the pinch center
    • Rotate (2 finger rotate): Spin the camera around the pinch center
    • Pan (2+ finger translation): Translate the the camera
  • 2D View:

    • Pinch (2 finger pinch): Zoom the slice in and out at the pinch center
    • Rotate (2 finger rotate): Rotate the slice intersection
    • Pan (2+ finger translation): Translate the slice

MacOS

Trackpad

  • 3D View:

    • Pinch (2 finger pinch): Zoom the camera in and out at the pinch center
    • Rotate (2 finger rotate): Spin the camera around the pinch center
    • Pan (Long tap and move): Translate the the camera
  • 2D View:

    • Pinch (2 finger pinch): Zoom the slice in and out at the pinch center
    • Rotate (2 finger rotate): Rotate the slice intersection
    • Pan (Long tap and move): Translate the slice

Linux

Untested. Probably some touchpad gestures work. Touchscreen may require configuration tuning (setting environment variables, etc.).

The interactions only work for trackpads that recognize gestures, such as the MacOS trackpad.
Other platforms (only tested windows) don’t support the use of the pinch/pan/rotate gestures with the trackpad.

If you have a debug build, you can try placing a breakpoint here to see if the gestures are received by Qt at all.

Windows and Linux only supports basic multitouch gestures on the touchpad (tap, click-and-drag, zoom, scroll), and pinch/rotate/pan only supported on the touchscreen. We have not tested touchscreen on Linux, but if multitouch is supported at operating system, driver, and Qt levels, then it should work in Slicer.

I guess that’s the problem. I recompiled with Qt 5.13.0 and it does not work as expected. In 3D, only zooming works, and in 2D, only scrolling. Tested on two laptops, both running Linux/KDE. Rotating in 2D would have been useful to me. I’ll research touchpad specifics on Linux, and post here if anything interesting comes up.

Regards.

Note that you can rotate slice intersections with basic gesture, too: using Ctrl+Alt+Left-click-and-drag.

Yup, I can’t believe I missed that for so long. I usually tinker with the reformat widget for the same result. It’s just quicker and precise this way.

By the way, I could not find a simple and decent soulution for enhanced touchpad gestures on Linux.

Thank you very much for this tip.