Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trackpad-specific input event support #482

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

thatcomputerguy0101
Copy link
Contributor

This adds support for pinch and rotation gesture events, as exposed from winit on MacOS platforms. Additionally, this associates ctrl-scrolling with the pinch gesture unless actual gesture events are detected since some Windows trackpads expose pinch information as scrolling with the ctrl key held. This somewhat breaks any custom control systems that expect pinch to zoom until they are updated with the new pinch event. However, since key modifiers are not made accessible to the camera control interface, any old handlers are still accessible by scrolling vertically.

Copy link
Owner

@asny asny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a nice feature to add 👌

src/window/winit_window/frame_input_generator.rs Outdated Show resolved Hide resolved
@thatcomputerguy0101
Copy link
Contributor Author

Instead of remapping events, I added the capability to execute different camera actions depending on the state of the modifier keys. This removed the Copy trait from CameraAction and CameraControl due to Box now being involved, but standard uses of those two types outside of the three-d crate should not be affected.

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.

2 participants