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

Closed
5 tasks done
arthurmougin opened this issue Dec 25, 2024 · 1 comment · Fixed by #574
Closed
5 tasks done

Keyboard controls is improperly mapped #573

arthurmougin opened this issue Dec 25, 2024 · 1 comment · Fixed by #574
Assignees
Labels
bug Something isn't working p3-minor-bug An edge case that only affects very specific usage (priority)

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.

@alvarosabu alvarosabu added bug Something isn't working p3-minor-bug An edge case that only affects very specific usage (priority) labels Jan 2, 2025
alvarosabu pushed a commit that referenced this issue Jan 2, 2025
* fix(KeyboardControls): support non-QWERTY keyboards

* docs(KeyboardControls): add mention of QWERTY/non-QWERTY layouts

* docs(KeyboardControls): fix wording/formatting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants