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

[BUG] Movement keys for non-query keyboards #239

Open
zevisert opened this issue Apr 6, 2022 · 2 comments
Open

[BUG] Movement keys for non-query keyboards #239

zevisert opened this issue Apr 6, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@zevisert
Copy link

zevisert commented Apr 6, 2022

Describe the bug
Non query keyboard layouts don't use keys in wasd position for movement

To Reproduce
Steps to reproduce the behavior:

  1. Go to fbe
  2. Add something so that you can see it move around when you move the viewport
  3. Change your keyboard layout to something like dvorak or colemak
  4. up down left right movement uses the keys for wasd, where ever they are on the keyboard.

Expected behavior
I think most people would assume that wars on colemak or ,aoe on dvorak would be used for movement

Desktop (please complete the following information):

  • OS: W11
  • Browser: Edge (Anaheim / Chromium based)

Additional context
I bet this could be solved by using keydown event.code instead of event.key (docs) for movement.

@zevisert zevisert added the bug Something isn't working label Apr 6, 2022
@zevisert zevisert changed the title [BUG] [BUG] Movement keys for non-query keyboards Apr 6, 2022
@teoxoy
Copy link
Owner

teoxoy commented Apr 6, 2022

Hmm, I wonder how other apps/games handle this since in the settings panel the key name is shown (instead of key code). I'm not aware of a browser feature to map key codes back to key names (which would depend on the keyboard layout).

What are your thoughts on this?

@zevisert
Copy link
Author

zevisert commented Apr 7, 2022

I'm not aware of a browser feature to map key codes back to key names (which would depend on the keyboard layout).

I'm not super familiar actually, but I know there is Keyboard.getLayoutMap(), and this reference code values page.

The other thing I saw recently that is kind of a good intro to how hard this is to get right is the latest HTTP 203 episode, if you're into video format.

Overall, there's a LOT to consider when it comes to input - I wouldn't expect every edge case to be handled, I just wanted to bring up the fact that movement is spread all over the keyboard for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants