Julow / Unexpected-Keyboard

A lightweight virtual keyboard for developers.
GNU General Public License v3.0
1.25k stars 167 forks source link

Unwanted characters present on the keyboard after configuring my custom layout #564

Closed evoneon closed 3 months ago

evoneon commented 4 months ago

Hi there! This app is essential to my daily life. I thank you so much for bringing this gem to us. Here is a behaviour I cannot explain and I would love a solution for it. Cheers!

Context Version : 1.26.0 Device : Android 13 (Samsung Galaxy S22) Today's date : 2024 February 18

Steps to reproduce

  1. Edit the default layout which is US QWERTY
  2. Remove many of the unwanted keys in the XML configuration file

Observed result

Expected result

Attachments

Spike-from-NH commented 4 months ago

No indeed, there is nothing in your XML file that calls for these characters.

Normally, if you use the "Add keys to the keyboard" option (gear icon above Fn), they go where the XML has something like key3="loc ...". Perhaps this is where they go by default. Please go into that selection and be sure these characters are unchecked.

evoneon commented 4 months ago

Thank you for your quick answer.

This is what I found in the settings you mentioned.

I tried to check them, leave and return in the settings to uncheck them. Didn't work.

1000005398

Julow commented 4 months ago

Thanks for the well written issue!

This is intended though I understand you'd want an option to control this. Especially that accented letters are easier to type since https://github.com/Julow/Unexpected-Keyboard/pull/559.

The keyboard will add the characters needed to type all the languages installed on your device, on every layouts. This is defined here: https://github.com/Julow/Unexpected-Keyboard/blob/master/res/xml/method.xml

For example, accent_grave:à:è:ù@a specifies that accent_grave (the dead-key) should be added, if possible on the same key as a, except if à, èandù` are already on the layout.

There might be a bug though, é and accent_aigu shouldn't be on the layout at the same time. What are your installed languages ?

Spike-from-NH commented 4 months ago

@Julow beat me to my response, which had been to concede confusion.

Adding characters based on locale may be right for built-in layouts but, when a custom layout is in effect, the feature seems more likely to confound the user than help, even if there were a way to disable it.

evoneon commented 4 months ago

My system languages are the following :

My Samsung keyboard's languages are the following :

So the é and ç characters make sense. After a few tries, I managed to hide them using « loc é » and « loc c » which made me quite happy! 🥳🎉😎

The only unwanted characters remaining now are the € and £ which aren't in the XML file nor checked in the "additional buttons" settings.

After reading the links you posted above, I noticed both the £ and € seem to be associated with the en-GB language (Image 1). I do not have this one enabled on my device but I noticed this following settings (Image 2) :

For some unknown reasons, the English language is associated to the United Kingdom and french with Switzerland. I'm wondering if there is a link between my Unexpected Keyboard showing UK, and the language us-GB being associated with the £ and € characters? This is the only hypothesis I have so far 🤨🤓

Julow commented 4 months ago

English (Canada) and French (Canada) are not mentioned in res/xml/method.xml, perhaps the system chose a close enough language instead ? That might also explain why Samsung Keyboard had English (US). Defining these languages would solve your issue.

£ and € indeed comes from the en-GB language, though that doesn't make sense for €, so I removed it in b29a344. Unfortunately, there's no option to avoid them yet.

Julow commented 4 months ago

Should be fixed in d7e5040. You can find a debug APK here: https://github.com/Julow/Unexpected-Keyboard/actions/runs/8030070025

Julow commented 3 months ago

The fix has been released.

AMTQ commented 3 months ago

Thanks for the clarification @Julow. I was struggling with this issue and trying to "remove" the unwanted modifiers by placing a keyX="space" for the position in question, but obviously that does not work but just shifts for example the accent_grave elsewhere 😄 so bottom line: place these modifiers somewhere out of the way? Or is there another way to deal with it?

Julow commented 3 months ago

@AMTQ What are the languages installed in your device ?

AMTQ commented 3 months ago

German and French.

Julow commented 3 months ago

accent_grave should disappear if you have à and è on your layout in the last version. (Before, you also needed ù)

Do you intent to make a layout without any of these ? This is not possible at the moment, the issue is: https://github.com/Julow/Unexpected-Keyboard/issues/388

AMTQ commented 3 months ago

Yes, that did the trick, thanks! With AOSP I did always change between the two languages, now I have just focused on german but with french letters available, see picture. Screenshot_20240310-220401_Vivaldi~(1)

It's a really cool app btw!

Julow commented 3 months ago

Nice layout :) Don't you have any problem typing â and à on the border of the screen ?

AMTQ commented 3 months ago

I don't know yet, as I use french rarely, maybe once or twice a week. But I think it should be fine, when writing with two thumbs it's ok... à voir, spontanement j'en connais même pas de mot avec â?!? 🤔

ps: ah lol il y en a des tonnes... https://www.motsavec.com/search.php?ms=%C3%A2 probablement je les ai écrit tous faux depuis des années 🤣