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

Keyboard controls is improperly mapped #573

Open
5 tasks done
arthurmougin opened this issue Dec 25, 2024 · 1 comment · May be fixed by #574
Open
5 tasks done

Keyboard controls is improperly mapped #573

arthurmougin opened this issue Dec 25, 2024 · 1 comment · May be fixed by #574
Assignees

Comments

@arthurmougin
Copy link

Describe the bug

When you receive a key event, you receive two values, the event.code (KeyA) and the event.key (A).
The key is equal to the pressed letter, but letters change based on keyboard layout.

While event.code don't.

Please swap the use of key to code, and use the proper values (A => KeyA).

Here is an example.
WhatsApp Image 2024-12-25 at 18 32 47

In my picture, WASD is as unusable as you can imagine, but if you use KeyW, KeyA, KeyS, and KeyD, then it will map to my ZQSD no problem.

Reproduction

https://cientos.tresjs.org/guide/controls/keyboard-controls.html

Steps to reproduce

Access the webpage with a keyboard of different layout

System Info

azerty layout keyboard

Used Package Manager

npm

Code of Conduct

@andretchen0
Copy link
Contributor

@arthurmougin

Thanks for pointing this out. A fix is in the works.

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 a pull request may close this issue.

2 participants