-
Notifications
You must be signed in to change notification settings - Fork 162
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
Fix French circumflex & umlaut accents #73
base: master
Are you sure you want to change the base?
Conversation
Replace circumflex accent obtained by modifier with the keyboard key available. This allows to be able to generate letters with umlaut using the modifier shift + '^'.
Memory usage change @ 83c76f3
Click for full report table
Click for full report CSV
|
This isn't a “fix”: it breaks the normal operation of the keyboard. Take this for example: Keyboard.println("un oiseau : ^o^"); With the master version of the library, it types:
With this pull request applied, it instead types:
(and my computer barked because it didn't know what to make of the sequence Circumflex + Enter that followed the “ô”). |
Hi, I don't know what system you are working on, but the expected behavior of the keyboard is precisely to press this key 2 times to get the diacritic alone. By the way, the current implementation of ` doesn't print the character directly either. Ex: You have to press Altgr + è twice to get ` and not ỳùìò etc. Also note that I'm on GNU/Linux, but you can also press 1 time then followed by a keystroke on Your example should be: See more about dead keys: As is from what I see of the code, it is impossible to generate a character with an umlaut. Stop me if I'm wrong but the press() function accepts 3 types of codes:
A workaround exists by defining some additional macros in the headers of the layouts but these only apply to simple keys. Lines 36 to 38 in a561178
To avoid the overflow it would be necessary to overload write(), press(), and release() to accept values greater than a uint8_t. |
Ubuntu 20.04 with the default desktop, French Keyboard, “French (alt.)” (a.k.a. fr-oss) layout.
The expected behavior of a real French keyboard is:
and yes, you could also abuse the dead circumflex to obtain a caret, but you don't have to. And the Keyboard library doesn't. Most importantly, the expected behavior of the library is that
You should get what you ask for: if
Keyboard.print("`"); does exactly that.
Typing non-ASCII characters is inconvenient, but not impossible. It is inconvenient because you have to tell the library exactly what keys to press: Keyboard.press(KEY_LEFT_SHIFT);
Keyboard.press(KEY_CIRCUMFLEX);
Keyboard.releaseAll();
Keyboard.print("u"); types
|
I think this is indeed a point to be clarified.
Thank you for giving your precise keyboard layout, because I have just understood that it is this layout in particular that makes the ` character not a dead key for you. Honestly, this is the first time I've come across a keyboard with this variant, which experimentally is never the default configuration either on Windows or on GNU/Linux (Debian, Fedora or Arch). On this certainly minor point, the result depends on the variant of the layout used. |
Interesting, I didn't know that ` (I mean, AltGr-è) could be a dead grave. Seems quite inconvenient for typing Markdown! I tried all the Linux layouts that seemed relevant to me:
Of these, only the one labeled “legacy” makes ` a dead grave. All the others have a regular backtick there, which is consistent with the article on the AZERTY keyboard in the English Wikipedia. This “legacy” layout is also the only one to have a dead acute at AltGr-&. And then, the French Wikipedia article on AZERTY states (emphasis mine):
It also carries a picture of the Windows layout, which does map ` to a dead grave. Now, back to the Keyboard library. If the user has a variant of the French layout with a dead grave at AltGr-è, then there is no way the library can properly support the backtick, and they would have to add a space after the backtick as a workaround. Regardless, the caret would always work without needing any workaround. |
Hi,
This PR replaces the circumflex accent obtained by modifier with the key directly available on French keyboards.
This brings the 0x2f scan code available and allows to be able to generate letters with umlaut using the modifier shift + '^'.
Gives:
îï
The KEY_CIRCUMFLEX macro is now redundant but I guess that's syntactic sugar.