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

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

Closed
evoneon opened this issue Feb 18, 2024 · 15 comments
Closed

Comments

@evoneon
Copy link

evoneon commented Feb 18, 2024

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

  • Some unwanted characters are present on some keys despite the changes in the XML file
  • These characters do not appear in the XML configuration file and I do not understand where they are coming from
  • See the attachments section for the specific characters concerned

Expected result

  • Beside the bottom row that seems to require a specific configuration, the other rows should match precisely the XML configuration file

Attachments

@Spike-from-NH
Copy link
Contributor

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
Copy link
Author

evoneon commented Feb 18, 2024

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
Copy link
Owner

Julow commented Feb 18, 2024

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 #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
Copy link
Contributor

@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
Copy link
Author

evoneon commented Feb 19, 2024

My system languages are the following :

  • English (Canada)
  • French (Canada)

My Samsung keyboard's languages are the following :

  • English (US)
  • French (Canada)

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) :

  • Image 1 : Special characters associated to languages Capture d’écran, le 2024-02-19 à 07 35 30
  • Image 2 : My keyboards 1000005407

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
Copy link
Owner

Julow commented Feb 22, 2024

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
Copy link
Owner

Julow commented Feb 24, 2024

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

@Julow
Copy link
Owner

Julow commented Mar 9, 2024

The fix has been released.

@Julow Julow closed this as completed Mar 9, 2024
@AMTQ
Copy link

AMTQ commented Mar 9, 2024

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
Copy link
Owner

Julow commented Mar 10, 2024

@AMTQ What are the languages installed in your device ?

@AMTQ
Copy link

AMTQ commented Mar 10, 2024 via email

@Julow
Copy link
Owner

Julow commented Mar 10, 2024

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: #388

@AMTQ
Copy link

AMTQ commented Mar 10, 2024

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
Copy link
Owner

Julow commented Mar 10, 2024

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

@AMTQ
Copy link

AMTQ commented Mar 12, 2024

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 🤣

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

4 participants