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

With an Italian layout keyboard, some keys do not work as expected #2292

Open
chrostino opened this issue Feb 9, 2024 · 4 comments
Open

Comments

@chrostino
Copy link

chrostino commented Feb 9, 2024

Description

backslash / to trigger latex command broken on non US keyboard layout (ITA)

Steps to Reproduce

  1. using a non US keyboard layout (in my case an ITA‌ ISO layout)
  2. go to https://cortexjs.io/mathlive/demo/
  3. press the \ key to trigger latex commands list and write some symbols/something

Actual Behavior

the \ character is written and nothing happens, while if i press the key ù (which position overlaps with the position of the \ key on the US‌ ANSI layout) then latex commands are triggered as normal

Expected Behavior

ù key just writes the character and \ triggers latex commands

Environment

Is this a regression: did it use to work in a previous version?

MathLive version 0.98.6
Operating System Nobara 39

Browser Firefox

@arnog arnog changed the title non US keyboard layout problem On Linux with an Italian layout keyboard, some keys do not work as expected Feb 9, 2024
@arnog arnog changed the title On Linux with an Italian layout keyboard, some keys do not work as expected With an Italian layout keyboard, some keys do not work as expected Feb 9, 2024
@arnog
Copy link
Owner

arnog commented Feb 9, 2024

Do you have a QWERTY or QZERTY layout?

FYI, the supported keyboard layouts are here: https://github.com/arnog/mathlive/tree/master/src/editor/keyboard-layouts

If someone has the mapping for an Italian Linux keyboard, feel free to submit a PR.

@chrostino
Copy link
Author

chrostino commented Feb 9, 2024

Thanks I didn't know different keyboard layouts needed to be supported
it's a QWERTY layout (ITA ISO), it's the most common italian layout, here's a picture
image

@Leon-Lj
Copy link

Leon-Lj commented Mar 8, 2024

We've seen similar problems with Norwegian/Swedish keyboards, I've been meaning to create and submit layouts for those but have not found the time yet.

As a quick hack you can listen to the keyDown event and simply override the result.

if (evt.key === 'ù') {
  mf.insert('ù', { format: 'latex' });
  evt.preventDefault();
}

@chrostino
Copy link
Author

I tried to make the italian one,
mind I have like no experience so it is just a tentative but maybe it can be useful
italian.txt

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

3 participants