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

OrbitalControls -> Allow mouse control to be null #144

Closed
alexpineda opened this issue Oct 25, 2021 · 3 comments · Fixed by #236
Closed

OrbitalControls -> Allow mouse control to be null #144

alexpineda opened this issue Oct 25, 2021 · 3 comments · Fixed by #236
Labels
enhancement New feature or request

Comments

@alexpineda
Copy link
Contributor

image
When using TypeScript the mouse control is not allowed to be nullable when in fact I wish to not have any control for that mouse button.

The typescript definition should allow MOUSE | undefined | null

@alexpineda alexpineda added the enhancement New feature or request label Oct 25, 2021
@joshuaellis
Copy link
Member

Is this allowed in three.js?

@alexpineda
Copy link
Contributor Author

alexpineda commented Oct 26, 2021

Yes.

https://github.com/mrdoob/three.js/blob/dev/examples/jsm/controls/OrbitControls.js#L953

It sets state to none if the switch case does not match any MOUSE enum.

@Lutymane
Copy link

Lutymane commented Nov 5, 2021

Maybe better do?

mouseButtons: Partial<{ LEFT: MOUSE; MIDDLE: MOUSE; RIGHT: MOUSE }>;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants