Skip to content

Keyboard remapper to offer a fallback for non latin keyboard users #17583

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

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

yafred
Copy link
Contributor

@yafred yafred commented May 26, 2025

fixes #16925

The idea is initially for the nvui interface, but the solution seems to fit mousetrap as a fallback if no binding is found.

Point of reflection/discussion: the fallback is systematic. Is there any case we would not want it ? (then we would add a preference)

I went for qwerty only because it seems to be the vast majority. There are other types of hybrid keyboards (like arabic / azerty) but we may never hear of them.

Demo here

The demo may not be compelling unless you consider that hybrid keyboards have the qwerty chars printed on them.

@yafred yafred marked this pull request as ready for review May 26, 2025 06:56
@ikrami1
Copy link

ikrami1 commented May 27, 2025

does this also fix #17579?

@ornicar
Copy link
Collaborator

ornicar commented May 27, 2025

I don't think websites are supposed to implement keyboard remappers. I don't know of any website that does that.

Github has an extensive list of keyboard shortcuts and no remapper.
How do these work on non-latin keyboards?

@ikrami1
Copy link

ikrami1 commented May 27, 2025 via email

@yafred
Copy link
Contributor Author

yafred commented May 27, 2025

@ikrami1 No this does not fix the nvui ... it is the preparation.
nvui and the visual site don't handle the keys the same way: in the visual site there is a single point in the code where this could be done, in the nvui it's more complicated. So I want to validate the principle first.

@ornicar I understand your caution. Let me test the github case and the youtube case to see if it changes my approach.

Just a bit more context in the meantime:
At the moment, the only way both for sighted and non-sighted users (with non latin keyboard) to use the shortcuts is to change their keyboard to a latin keyboard (mostly qwerty I reckon). When they do that, they cannot write anything in their language until they swap again: For example, they cannot chat in or out of Lichess.

@yafred
Copy link
Contributor Author

yafred commented May 27, 2025

The tested situation with shortcuts on Github and Youtube (which is what I expected based on @ikrami1 's comment).

Github does not translate their interface and they rely on the characters (event.key) for the shortcuts. QWERTY and AZERTY users will be able to go to wiki tab typing 'g w' (letter w being in 2 different locations on the keyboard). Users with non latin keyboard don't have access to shortcuts.

Youtube uses characters and fall back on qwerty positions. Example to mute the video:

  • QWERTY users will type 'm'
  • AZERTY users will also type 'm' but it's a different keyboard location (proving that youtube handle the characters)
  • Arabic users will type 'ة' which is the character located on QWERTY 'm'

So, we would do like Youtube

@yafred
Copy link
Contributor Author

yafred commented Jun 4, 2025

@ikrami1 while I was looking for another solution that would not involve Lichess code, I found out that there is a very quick way to cycle through your keyboard layouts.
In case you don't know yet, on Windows, there are 2 shortcuts that you can use to go back and forth if you have 2 keyboard layouts configured.

  1. Alt shift
  2. Windows space

I don't know how you know the layout your are using when you are back on your computer after a pause

@ikrami1
Copy link

ikrami1 commented Jun 4, 2025 via email

@yafred yafred marked this pull request as draft June 18, 2025 17:17
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 this pull request may close these issues.

Shortcuts do not work when the keyboard is not set to english
3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy