Bad keyboard mapping using AtlGr on a French keyboard
- @david
I'm on French keyboard (AZERTY), so the pipe id done using the "AltGr + 6" keys but all i'm getting it a minus ("-") sign despite keyboard history show I'm using the "|" symbol.
=> This is also true for all symblols accessed via the Alt Gr key on a french keyboard: accolades, barckets, backslash (see screenshot)... You can guess this is quite annoying, especially regarding the price this tinypilot is sold: I expected such "simple" things like a keyboard to work out of the box on such an expensive piece of hardware !!
I see other users having the same issue in this forum, but no solid solution provided: just random resolves/workarounds, very deceptive...
- David @david2024-04-04 14:24:52.308Z
Hi @Taz, I'm sorry you're experiencing this issue with AltGr on your TinyPilot.
The issue you're describing sounds similar to a known issue with AltGr on Swiss German keyboards. In that particular instance, the web browser itself is reporting incorrect information about the key press, so that may be the case here, too.
Can you let me know whether the behavior the same if you use the right-hand Alt key on TinyPilot's on-screen keyboard?
Could you tell me which browser you're using? e.g., Chrome, Firefox, Safari, etc.?
- TIn reply toTaz⬆:@Taz
Hi David,
First, I'd like to apologize for angry tone in my first post: I brought the Tinypilot a few weeks ago and just faced this keyboard issue when I needed it to work...
That was "hot reaction" from me, and I thank you for your diplomatic reply: I cooled down since yesterday so I'll be more kind !Then, to provide you with answers:
- Browser: I'm using Brave (a fork of Chrome) on Ubuntu, according to the about this is "Version 1.64.113 Chromium: 123.0.6312.86 (Official Build) (64-bit)".
I also have to say that I put English as favorite language (cause automatic translations on some site is so horrible) - OSD Keyboard: that's a good idea that I didn't have when facing the issue !
And indeed, it works using the OSD keyboard, but not as it is displayed: I had to use the same key that I would have used on a French keyboard (the "6" key to have a "|" => see sceenshot below)
=> Looks like another heavy bug, but let's stick to real keyboard and keep the OSD keyboard issue for another day/post !
As for other users exeriencing same issue (I saw it for a French-Canadian keyboard user as well ont this forum where you also posted repliies: Right Alt not working in tinypilot's web interface ), I tried to have look in the logs but didn't found anything...
I may not be looking at the right place: maybe you can tell me where to look to provide you with more details ?I also went to http://keycode.info/ to provide browser inputs.
- That's when pressing "Alt Gr" (right Alt) key:
- And that's when keeping "Alt Gr" pressed and pressing "6" et the same time:
I also spotted that scrolling back in the console using "SHIFT + PG_UP" didn't work as well: as a heavy Linux console user, you may guess that it can be quite annoying.
Thank you David for having a look into this, but in your 2022 post, you said you raised a bug to the involved piece of software developpers: I can guess this was not corrected, so I'm not having high hopes in a resolution for my case either...
- David @david2024-04-05 12:11:23.526Z
No problem!
Thanks for all those details and screenshots!
The behavior using right-hand
Alt
+6
with the on-screen keyboard is expected here. The on-screen keyboard displays a US layout, but the target machine interprets the keystrokes based on its own language settings (French in this case).I've just done a couple of tests on my own machines, and I managed to reproduce the behavior on one of my setups, but not the other. It looks like the difference is whether the client machine (and browser) interprets the keystroke explicitly as
AltGr
, or as a right-handAlt
. This seems to depend on the keyboard layout your operating system is using.Here's a screenshot showing
AltGR
+1
through to0
on my first set up (interpreted as right-handAlt
):And a screenshot showing
AltGR
+1
through to0
on the second set up (interpreted explicitly asAltGr
), reproducing your issue:To confirm my suspicions, are you able to switch your Ubuntu machine's keyboard layout to the English (US) layout and test your physical
AltGr
+6
key combination? My expectation is that your browser will interpret that as a right-handAlt
key press, and you should see|
on your target machine. If that does happen, it confirms that my understanding of the behavior here is correct.Hi David,
Sorry for delay in replying: I was away for the WE...
For note, here's screenshot of the key sequence with AltGr and keys from 1 to 0 with my current FR keyboard setup (1 does not have any corresponding character on a French keyboard).
=> Key log at the end of screen only shows history from key "4".Now the same after switching to US keyboard:
=> The keys behave as expected from a FR keyboard !! Your supposition was indeed right !NOTES:
- having the "¹" for the key "1" was not expected, but as you see it also works in browser or in a terminal: nothing to worry about I guess...
- the whole keyboard behave as a FR "azerty" keyboard instead of US "qwerty" despite being US in other windows (the FR to US switch was well effective in my desktop environment)...
- pressing AltGr key don't shows as AltGr in the log, but "only" as Alt:
I hope this will help you to provide a correction or a workaround for the issue (changing the locale in Tinypilot ? currently LANG=en_GB.UTF-8 in env and in /etc/default/locale).
Thanks again & looking forward to read you back !
- David @david2024-04-08 12:28:41.319Z
Thanks so much for confirming all that, @Taz!
It definitely looks like this issue matches the behavior in the GitHub issue. Effectively, browsers aren't interpreting
AltGr
keystrokes correctly. Since TinyPilot relies on the browser to correctly interpret the key, this bug affects the keypress value TinyPilot forwards to your target machine.Changing your client machine's keyboard layout to English (US) changes the way your browser interprets the
AltGr
keypress on your physical keyboard into right-handAlt
. Because your target machine's keyboard layout usesAltGr
, when TinyPilot forwards the right-handAlt
keystroke, your target machine correctly interprets it as anAltGr
keypress.Unfortunately, I don't know if there's a simple way to handle this. Just using a different locale alone won't help - the browser knows that
AltGr
was pressed, but it doesn't setaltKey
totrue
, which is causing this issue.The two solutions I can see are:
- Browser developers fix the bug, adding
"altKey": true
toaltGr
keypresses. - We develop a workaround that overrides the value TinyPilot sends to the target machine based on the locale (by adding
"altKey": true
), which Michael suggested in the GitHub ticket.
This workaround isn't part of our short-term roadmap yet, but we’re always working to improve TinyPilot’s software and hardware. We prioritize features based on user demand, so we’ll definitely consider your feedback in our planning. And I've added a comment to say this issue seems to affect all keyboard layouts using
AltGr
.Unfortunately, I don't have any other suggestions to fix this issue. I understand that the workarounds aren't ideal. However, if you spend a prolonged period of time using your TinyPilot, setting your client machine's keyboard layout to English (US) should allow you to type normally with
AltGr
if your target machine has its layout set to French.Please let me know if you have any questions.
- Browser developers fix the bug, adding
- Browser: I'm using Brave (a fork of Chrome) on Ubuntu, according to the about this is "Version 1.64.113 Chromium: 123.0.6312.86 (Official Build) (64-bit)".