Spanish keyboard - default long press to diacritical mark on vocals (tilde por defecto en pulsación prolongada)
Hello, in the Spanish keyboard, can you make it so that the first thing that pops up when I long press a vocal is the diacritical mark? (En español: ¿Puedes poner la tilde por defecto al hacer una pulsación prolongada?) It is pointless that it defaults to a number, like 3, since we are in the "keyboard for letters", and in my case, I also have an additional row for numbers; and in Spanish, we are constantly typing á, é, í, ó, ú; so it is very cumbersome to have to slide around to find the correct accent mark. I know that every other keyboard has the same problem, so your keyboard would be the best out there if you fix this problem. I have already seen a lot of people complaining about it, since in the previous version there was only an option for this kind of accent symbol, but you had left out the diaeresis ( ¨ ), which is also used ocasionally, and also useful for typing in German (where it is very common) without having to change to a different keyboard. I love that I can type in 3 languages (English, Spanish, and German) with the same keyboard, because I don't have to memorize different key arrangements. So it would be nice if the diaeresis was also right next to the diacritical mark in the pop-up window. Thanks
I think most of us prefer to default to a number. It's possible to make it so that you can choose between having or not having a number, but that requires publishing a new version of AnySoftKeyboard first.
Solving your issue can actually make creating a layout easier, but I'd like to ask the opinion of @menny and @AnXh3L0 on this:
I was thinking of allowing a new code in keyboard layouts: ask:numberPopup or similar. The contents of this code would be added to the contents of popupCharacters (read from android:popupCharacters or from defaults) in a key.
Exactly when are these contents added could depend on the presence of a number key row, or on a new setting like this:
Add digits to the characters on long press
- Add before accented letters and other symbols
- Add after accented letters and other symbols
- Never
It would also be interesting to have the contents of the default popupCharacters added to the popupCharacters in the language pack, removing repeated characters. (For example, if the default are DFGBE but the language pack specifies ABCDE, then add to the key the contents ABCDEFG)
These two changes would simplify extra layouts greatly. One would only need to add the characters that are strictly necessary to write a language, and then have the characters from other languages sort themselves out.
I was working on something similar. I thought it'd be nice if you could just add the popup key xmls for the different default qwerty-esque (qwertz, dvorak, etc) keyboards for each language, and then any language specific keyboard files. I created a file (still has a few errors to sort out) that has the accents that each language needs. This is basically what you are talking about, yes?
It's part of it, yeah. And your compilation would help a lot. :smile:
The basic idea is that the layout designer would only add the relevant characters, but the end user would still be able to insert all the characters.
They'd just be reordered depending on the keyboard layout. Using your file as an example... compare "Spanish" and "Southern Sami (Sweden)". Any user should be able to type ä, å and á, but in a Spanish keyboard you'll want á to be easier to type (the very first character in the popup, you won't have to move your finger at all), while a Swedish-speaking typist would probably prefer ä.
This way, every time a new version of AnySoftKeyboard is released, you'll automatically be able to type more characters, but it won't make your own language more difficult to type.
(One of the reasons I'm asking for opinions is because some people may find it bothersome to have 10+ letters in a single key if they don't think they'll use them.)
The other idea (and the most important in my opinion) is to be able to choose whether to default to a number or to a letter when holding a key in the topmost row. We would be able to remove clutter from the language packs, and it would also keep both @pwaser (who'd rather have no numbers in the letter keyboard) and me (who'd rather have them) happy and typing fast. ^^
That sounds like a great idea. And yeah I'm not sure how many people would want that, but sounds like a useful option nonetheless. I would especially love to have the numbers under the top row of letters to be optional, all the layouts i make dont have that because i use a top number row or just click the symbols button, but im sure other people want it, like you, lol.
these suggestions would be nice.
I think that if we add a mechanism (layout-designer?) that scans all popup-characters and removes characters that are already available as primary-codes in keyboard-layout we don't need the numberPopup attribute.
We can also automatically add (to the end of the popup-list) the missing accents. This way, the pack can define which accents are the priority and then ASK will add the missing accents.
Regarding numbers as popup-characters, I think that the pack author should decide on which key they go (in the Hebrew pack, the numbers are in the second row, while in most packs it's in the first). We can then let the layout-designer shuffle the number position in the popup (or completely remove any digit).
I now recall we have somewhere a mechanism that removes the language-key if:
- the key is marked with
if_applicable. - and, there is only one enabled keyboard.
I don't recall where it is exactly, but it scans the keys for that attribute and then decides if the key should be visible and if not, it re-arrange the keys in the row to compensate the extra space.
oh! And there are two other modifiers:
- compressing the keyboard to left/right/split
- adjust default skin-tone in the emoji keyboard
Along with this, being able to modify the punctuation marks that are in common bottom rows based on the language would also be helpful, i.e., have ; instead of ? in Greek.
I like the idea of this language-based priority for symbols. I like to have all the symbols, because I speak many languages. I also don't mind the number popout on the keys, but just not as the first pick; I want it to default to the Spanish accent, since I have the Spanish keyboard. Thanks for working on this feature!
This is going out of control hahahahaha
@pwaser: For the moment we're just discussing ideas felices, and it might take a long time to have this all sorted out, but I'm glad you're liking it and participating in this. Just please be patient! (Even in a best-case scenario, these features should not be used in official language packs until they are in a stable version on both F-Droid and Google Play, for obvious reasons.)
@menny: That's the best part. The file with default popup characters doesn't assign a number to any letter. The numberPopup attribute (please anybody help me find a better name) is only meant for language pack developers. So it would be trivially easy to set numbers in the top row, in the middle row, scattered all over the keyboard or every single key.
I don't see how is the key hiding mechanism useful for this issue in particular (we're talking about hiding/showing characters in a popup, not whole keys) but we'll need it to solve other issues, thank you.
The default skin-tone is something we'll need to have in mind. I don't know if the emoji keyboards use the same code than the regular keyboards.
@martholomew YES to your idea. You're not first one suggesting that, actually (that topic was brought up at another issue, I forget which), but we need a concrete plan of action. They're even more chaotic than the letter keyboards.
Right now, the current bottom rows are the files starting with ext_kbd_bottom_row. They're basically six similar designs, every design can have up to two files (with and without microphone key) and every file includes information for five types of text field (unspecified, IM, URL, email and password). Language packs can replace the default one if the user allows it, but including up to 60 rows is horribly messy, boring and prone to errors.
There are several issue reports asking to allow for more customisation and more simplification of these rows, which seems contradictory and won't help us advance one iota.
So the only sensible solution I'm seeing here is defining something like HTML entities, for example defining a key like
<Key android:codes="˙" android:popupCharacters="&question;&exclamation;" />
where the default values are . for ˙, ? for &question; and ! for &exclamation;, but you'd be able to set &question: to ; just for your Greek layout or ¿? for the Spanish one.
If any of you has some other solution, please tell me so.
IMPORTANT EDIT: To avoid more insanity than strictly necessary, I think that the symbols pages should not use these new features (so you can expect characters like "¥" and "¿" to remain in the same place no matter which keyboard are you typing on).
I don't know if @menny had already thought of this, but I just realized a new problem with layouts, and a much simpler way to add this customization.
There are several languages which, in practice, can have letters, numbers and or symbols in android:popupCharacters. Check this real line, from the French package:
<Key android:codes="97" android:popupCharacters="à1á@âãäåæąā¹₁" ask:hintLabel="1" android:keyEdgeFlags="left"/>
Some language packs even have several layouts just in case you want symbols with your letters.
I was thinking on defining a new tag like ask:numberPopup, but: what if we just keep throwing every single character on popupCharacters, but mask and reorder them depending on users' preference?
With the above example, when reading that XML, ASK would:
- Add the default characters to the characters defined on XML.
à1á@âãäåæąā¹₁+àáâãāäåæąăαª=à1á@âãäåæąā¹₁àáâãāäåæąăαª - Remove repeated characters (we save only the leftmost copy, so that the XML decides the priority):
à1á@âãäåæąā¹₁àáâãāäåæąăαª→à1á@âãäåæąā¹₁ăαª. (Weird example, we only added superscript A for ordinals and A-breve.) - Check in the general settings an option like this:
SHOW/HIDE MORE CHARACTERS WHEN HOLDING A KEY
- Only letters
- Numbers before letters (the default)
- Letters before numbers
- Numbers, letters, symbols
- Letters, numbers, symbols
- (do we need more options?)
- Suppose, as an example, that the user selects "Letters, numbers, symbols" (no symbols). We create a StringBuilder, and then scan the string left to right, one character (Unicode codepoint) at a time:
4.1. We append to the StringBuilder just the characters which return true on
Character.isLetter():àáâãäåæąāăαª4.2 We scan the string again and now append characters which testCharacter.isNumber():àáâãäåæąāăαª+1¹₁=àáâãäåæąāăαª1¹₁4.3 Yet again, but only for symbols:àáâãäåæąāăαª1¹₁+@=àáâãäåæąāăαª1¹₁@ - If the user selects another option, when the keyboard is built, skip or shuffle steps 4.1 through 4.3.
This way, we don't need to update again every language pack when this is implemented, and we can remove duplicate layouts like "English with symbols" and "Portuguese with symbols".
While a good idea, I don't think it solves a problem that I have: that there are many keyboards which work for a lot of languages. I think it would be nice if for these keyboards you were able to define in some sort of a file (maybe something like latin_customization.xml) the diacritics and punctuation that you would need to have customized on these keyboards for the language. However, this creates the problem of having many, many keyboards for each and every language that uses them. A solution could be to change up the UI somewhat: Language > Enable keyboards and languages. > $LANGUAGE (would be a good place to use the flag svgs) > [All the keyboards for that language]. This would sort things more effectively just to avoid an endless list on the main keyboard screen; of course, you would still be able to select as many keyboards from as many languages as you wanted.
Let me make an example for a latin_customization.xml for Afrikaans (lets pretend it uses a ; for a question mark like greek):
<?xml version="1.0" encoding="utf-8"?>
<Customize xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ask="http://schemas.android.com/apk/res-auto">
<Key android:codes="a" ask:diacritics="á"/>
<Key android:codes="e" ask:diacritics="éèêë"/>
<Key android:codes="i" ask:diacritics="íîï"/>
<Key android:codes="n" ask:diacritics="ʼn"/>
<Key android:codes="o" ask:diacritics="óôö"/>
<Key android:codes="u" ask:diacritics="úûü"/>
<Key android:codes="y" ask:diacritics="ý"/>
<Punctuation ask:interrogative=";"/>
</Customize>
A solution could be to change up the UI somewhat: Language > Enable keyboards and languages. > $LANGUAGE (would be a good place to use the flag svgs) > [All the keyboards for that language].
The UI needs some way to filter keyboardsi I agree with this. Every layout pack defines two or more layouts and it quickly becomes cluttered.
But I'm honestly not sure about your ask:diacritics proposal. It's less redundant that what we have now, but you need to somehow reference a basic QWERTY/QWERTZ/AZERTY layout...
<?xml version="1.0" encoding="utf-8"?>
<Customize xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ask="http://schemas.android.com/apk/res-auto">
<Keyboard xml="@xml/international_qwerty">
<Key android:codes="a" ask:diacritics="á"/>
...
</Customize>
which only makes sense to define on the ASK app, making them completely incompatible with ASK until a new version is released at F-Droid and Google Play.
I don't see why wouldn't you be able to get what you want with mask-and-reorder; you'll need a XML file per layout all the same:
<Row>
<Key android:codes="q" android:keyEdgeFlags="left"/>
<Key android:codes="w"/>
<Key android:codes="e" android:popupCharacters="éèêë"/>
<Key android:codes="r" />
<Key android:codes="t"/>
<Key android:codes="y" android:popupCharacters="ý"/>
<Key android:codes="u" android:popupCharacters="úûü"/>
<Key android:codes="i" android:popupCharacters="íîï"/>
<Key android:codes="o" android:popupCharacters="óôö"/>
<Key android:codes="p" android:keyEdgeFlags="right"/>
</Row>
...
(On the final keyboard. the user would still see éèêëęėěēẽẻε€ under e ).
Yeah, the UI needs some help in lots of places, lol. Ah, here's a nice issue for that.
The xml per layout is the issue for me. The latin_customization.xml would be referencing all the default latin xml keyboards, not one per keyboard. I do know that it would require a bit of restructuring, but I think that it would pay off by making it much easier to create language packs in the first place (if the language uses the Latin alphabet), as you wouldn't have to worry about editing the default layouts, you would just need to make any language-specific keyboard layouts and edit latin_customization.xml. This would get rid of a lot of bloat, in my opinion.
[Edit:] In other words, while you are right, I think that this would be the best solution to smooth the process of adding languages in the future while normalizing the duplicated keyboards between languages.
THANK YOU for the link to that issue, now I don't have to search blindly to find it.
I'm starting to understand your issue but something doesn't add up...
You still need a latin_customization per language pack because they're independent from each other. A latin_customization file can replace... two files, tops, assuming your language uses, for example, both QWERTY and AZERTY.
Also, lots of languages add extra keys, forcing you to either write a language-specific layout, or to define a mechanism to append keys to the end of a row in your Customize file. I'm still not seeing the pay-off.
Filesize doesn't matter that much when almost all of it is taken by dictionaries. (Nice job on #324, by the way!)
No prob.
Alright, I'll concede, my idea might be a lot of work for not much payoff. In that case, I have suggestions for your masking:
- Language-Specific Diacritics
- All Diacritics
- Symbols
- Numbers
These would all be re-orderable checkboxes ([edit] not sure the exact name, but its the thing that looks like this) in settings. I think that this would solve all sorts of problems people have.
And thanks!
☺️
- Language-Specific Diacritics
- All Diacritics
- Symbols
- Numbers
These would all be re-orderable checkboxes ([edit] not sure the exact name, but its the thing that looks like this) in settings.
Makes sense.
@ArenaL5 at this point, it would probably be wise to move this idea to a separate issue, lol.