On french keyboard, when Shift pressed, the letter displayed is wrong
Hi, Thanks for your useful tool to succeed Key-Mon. My system : Ubuntu 20.04 Mate Édition. I used it on a French Occitan keyboard but when I press the shift key and the A key it's "Q" that is displayed (not "A" as expected). No problem if Shift key is not pressed : when I press A, "a" is displayed. It seems like the Shift key doesn't consider the french layout defined but the english keyboard layout. Regards,
Thierry
Zut alors! Je suis désolé. Cela prendrait beaucoup de temps à résoudre car je n'ai pas de clavier français et je devrais apprendre comment le logiciel de touches de clavier natif prend en charge l'internationalisation. Connaissez-vous quelqu'un qui serait prêt à nous aider?
Hi, I can help you for testing but I'm not developer... Regards,
Also using a French keyboard, on Kubuntu 20.10. I note the same buggy behaviour with the Cap-lock.
I had a look at this: https://github.com/DaveJarvis/kmcaster/blob/a1e41cd944f63222eb38edc5bd9c5265b606d451/src/main/com/whitemagicsoftware/kmcaster/listeners/KeyboardListener.java#L88 I'm not a java developer so I'm very unsure but... these looks like ASCII code of what we want to show (not like keyboard position) ; see https://theasciicode.com.ar/ascii-printable-characters/space-ascii-code-32.html
Would adding lines of code like the following do the trick?
entry( 65, "A" ),
Not a solution for the kmcaster source code... but a workaround to help non-US-keyboard users use kmcaster despite this bug. (I do not aim to bother kmcaster's authors, who I warmly thank here!!).
I launch kmcaster then launch screenkey on top of the "letter" part of kmcaster. Specifically:
I launch kmcaster then, in another terminal window, I launch:
screenkey --show-settings
I use the button with screenkey's option to draw the region where to put screenkey's window. I draw it above the right part of the kmcaster window (actually, I draw it much wider... this way we can see several keys).
It works nice. Hope this helps.
Would adding lines of code like the following do the trick?
entry( 65, "A" ),
That would display an uppercase "A" whenever the "a" key is typed, which would then not display the logical key. key-mon uses this approach to display the physical key, but since a physical key represents more than one character, I prefer showing the logical key.
The NativeKeyEvent object is used to look up the key code in a list that maps key codes to displayed characters. This approach may not work for keyboards that allow accented characters, or non-Latin-based keyboards. Ideally, we'd have a number (key code) that can be mapped to a particular character that's then displayed. Here's the line where the conversion from a key code to a character happens:
https://github.com/DaveJarvis/kmcaster/blob/a1e41cd944f63222eb38edc5bd9c5265b606d451/src/main/com/whitemagicsoftware/kmcaster/listeners/KeyboardListener.java#L295
If there was a key code for an accented "a", then we could add an entry in the map. There could be a different API that we should use for the native key library that returns the textual description suitable for display. I haven't investigated this possibility.
Please try again using KmCaster version 1.1.1.
Hi Dave, Thanks for your work and the 1.1.1 version. But with my french keyboard (AZERTY), the key displayed are wrong : when I type "A" (shift + a), KmCaster display "Q" (QWERTY). No problem when typing "a". The keys "2" (in french "é"), "7" (in french "è"), "9" (in french "ç"), "0" (in french "à) aren't displayed : the numbers are displayed. Regards
On the main projet page, the Download link doesn't work.
On the main projet page, the Download link doesn't work.
Fixed, thank you.