-
-
Notifications
You must be signed in to change notification settings - Fork 35.6k
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
OrbitControls: Introduce listenToPointerEvents(). #21224
Conversation
Ah, I forgot about the
Does |
It's actually the term |
Maybe as suggested in #20575 and use |
This is fantastic, thanks! |
@Mugen87 is there a reason key events are not added by default but through a connect function? i wonder, couldn't these two just be combined? |
How about |
In this case we would have controls.listenToEvents( renderer.domElement ); // default method for setup event listeners
controls.listenToKeyEvents( window ); // additional method for specific events. The
Yes, key event listeners are better placed at |
Don't forget about |
This PR is heavily outdated. I'll file a new one when we have agreed on the new API of |
Related issue: #20575 (comment)
Description
Introduce
listenToPointerEvents()
which must be used to add event listeners for point events. The second parameter ofOrbitControls
is now deprecated (but still functional).To me, the change has one minor flaw.
listenToPointerEvents()
does not only register event listeners to pointer events but tocontextmenu
,wheel
andtouch*
events, too.However, as far as I understand the point is to create an instance of
OrbitControls
without adding event listeners in the ctor. Still, the name oflistenToPointerEvents()
is not quite right...