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

Improved international keyboard support in demos #81

Closed
ubunatic opened this issue Sep 13, 2021 · 7 comments
Closed

Improved international keyboard support in demos #81

ubunatic opened this issue Sep 13, 2021 · 7 comments

Comments

@ubunatic
Copy link
Contributor

ubunatic commented Sep 13, 2021

The playable demos have a bad UX on non-EN keyboard layouts.
Please add a few alternative keys, e.g., for Watris:

  • Add C as more universal "hard drop" key (Z is always a bad choice as an action button, e.g., for DE and FR layouts, where it is not next to X).
  • ArrowUp as "spin" key and ArrowDown as "hard drop" key, to allow full one handed control on any keyboard (and making it playable for one-handed people).

And, I guess there are also other smart choices for the other demos, for good UX worldwide, and for one handed control.

@eXponenta
Copy link
Contributor

eXponenta commented Sep 13, 2021

Accessibility is not a main option.

X, Z + Arrows is selected as generics layout (all emulators use this binding).

If you want change this, you should provide a PR for site, docs and runtime , because not all has a FR layout and non-EU keyboard.
I can said more - generic layout is EU :)

And you CANNOT change layout a game specific, because it limited specially.
Looks to docs about this:
https://wasm4.org/docs/guides/user-input#gamepad

If a devs select a ArrowDown as input - him think that this is good.

@FaberVitale
Copy link
Contributor

FaberVitale commented Sep 13, 2021

Hi @ubunatic,

This is more an a11y issue of the console:
cartridge developers do not have access to raw keyboard keypresses and current layout, as @eXponenta said, it is rather common.

Generally emulators resolve the issue you raised using a window that allow to customize keys.

We should probably add a similar feature and persist the custom key mapping.

@aduros
Copy link
Owner

aduros commented Sep 13, 2021

Add C as more universal "hard drop" key (Z is always a bad choice as an action button, e.g., for DE and FR layouts, where it is not next to X).

This should actually already be the case, we alias C to Z, in addition to Y to Z for German keyboards. We even include Dvorak-friendly mappings for Z/X. This is not at all obvious though, so let's add some documentation about it.

Here is where the Z/X keys are handled:

case 88: case 32: case 81:

If there are missing Z/X aliases for other keyboard types, let's add them. In the future having customizable keybinding as @FaberVitale suggests will also be fantastic.

@christopher-kleine
Copy link
Contributor

X, Z + Arrows is selected as generics layout (all emulators use this binding).

Just because "everyone is doing the same" doesn't mean it's the best way.
In fact, I complained a few times in the TIC-80 discord about this.

in addition to Y to Z for German keyboards

That's pretty much why I mentioned this in the small text under my game. Maybe this should be mentioned below the playable games. Currently it only states "Arrow keys" and "Z/X".
Something like

Arrows keys = D-Pad
X = Button 1
Z/C/Y = Button 2

might make it more obvious.

@ubunatic
Copy link
Contributor Author

ubunatic commented Sep 13, 2021

I did not realize that C was bound too automatically 🙈. This already solves half of the issue.

I also checked some more keyboard layouts (PT, ES, CN, Arabic, etc.) and most seem to have Z in the "right" place next to X, it is only DE, FR, and some others that have them "misplaced". By having C/Y/Z bound to Button 2, you already cover most of the planet I guess.

Then the issue is more in the hint below the demo games on the website as @christopher-kleine said.

I still think, Watris should get the D-Pad down bound to "drop" as it the original GB game had it.
Then the Buttons 1 and 2 could be used left/right rotation (I also think the GB game had it like that).

I will check the code and try do PRs for Watris and the website (after getting the project to run on my machine).

@ubunatic
Copy link
Contributor Author

ubunatic commented Sep 13, 2021

PR #87 for improved Watris keys is open.
PR #88 for hint to alternative keys is also open.

Btw. the "60 second" dev setup was super smooth, npm install wasm4 (without the -g)
And then a simple make && ~/node_modules/wasm4/cli.js run build/cart.wasm to test it. 👍

@aduros
Copy link
Owner

aduros commented Sep 13, 2021

Btw. the "60 second" dev setup was super smooth

Good to know 😄

@aduros aduros closed this as completed Sep 13, 2021
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

No branches or pull requests

5 participants