godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.12k stars 69 forks source link

Add touchscreen/trackpad event navigation in the 3D editor #2295

Open ViktorEvil opened 3 years ago

ViktorEvil commented 3 years ago

Describe the project you are working on

currently working on a few 3D prototypes but using an Mac (M1 MacBook Pro)

Describe the problem or limitation you are having in your project

Currently navigating in the 3D scenes feels clumsy and does not feel native to other MacOS apps

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Mac Trackpads are very multitouch dependent. In Xcode whilst browsing around a SceneKit scene it is very fast and easy to do using just the Trackpad

2 Fingers touching are used to pan around a scene 2 Fingers pinching for zoom 3 Fingers touching for orbit around the current centre of the view

using these few simple gestures I don't have to find the modifier keys on my keyboard to help with navigation.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

An option in the current Navigation Setting screen could enable this. The current dropdown list of "Godot", "Maya", "Modo" could have "MacOS" as well

If this enhancement will not be used often, can it be worked around with a few lines of script?

I think all Mac users would prefer this control scheme and even Windows users with multitouch drag pads would find it useful.

Is there a reason why this should be core and not an add-on in the asset library?

Control schemes should always be implemented at a core level.

Calinou commented 3 years ago

An option in the current Navigation Setting screen could enable this. The current dropdown list of "Godot", "Maya", "Modo" could have "MacOS" as well

Since none of the current navigation modes currently use touchscreen events, this "macOS" navigation mode might as well be always enabled. Also, https://github.com/godotengine/godot/issues/13139 will need to be implemented first.

DarkKilauea commented 3 years ago

This would be very helpful for windows laptops with touchscreens or track pads, especially the Surface line.

As a workaround, on my laptop, I've set the following Editor Settings:

These settings make the 3D editor usable with only a track pad.

blackears commented 8 months ago

Where in the code is the zoom pinching handled? I'm getting lost looking through the editor source files.

AThousandShips commented 8 months ago

Looks like here: https://github.com/godotengine/godot/blob/0bcc0e92b3f0ac57d4c4650722f347593a258572/editor/plugins/node_3d_editor_plugin.cpp#L2081-L2088

eobet commented 5 months ago

This should not be limited to 3D, but also the visual shader editor, which currently (4.3 preview 5) is completely unresponsive to most multi-touch inputs and problematically zooms in and out with two finger scroll instead of moving in the direction of your fingers... (tested on Linux).