-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
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
pointerlock controls example : fix key listeners #21055
Conversation
It's probably best to only change Especially after a PR was approved, it's problematic to add more commits (since it invalidates existing reviews). |
@Mugen87 Yes sorry, initially I just thought of fixing this example, but I found a lot more with problems... I'm done checking the examples now, I will do as you said 👍 |
47d2bbf
to
71f4cb5
Compare
@Mugen87 I reverted to the state it was at when you reviewed it, and I will make a new PR for the rest of the changes, including the changes in |
In this PR it seems you have force-pused which is totally fine. |
Thanks! |
Issue : the pointerlock example, FirstPersonControls and FlyControls checked the
keyCode
property of thekeydown
andkeyup
events, which means it was bound to characters. Some keyboard layouts, like the French one displayed bellow, don't map the WASD keys at the same place, whereas we actually play with the same keys as everybody, only these keys represent different characters.The present PR solves this by using the event.code propery, which is layout-independant. It will also solve the problem for Russian or Chinese layouts for instance.