nightkr / flickboard

Flicking keyboard for Android
GNU Affero General Public License v3.0
129 stars 25 forks source link

Magic top-left key to implement complex characters #72

Open lud opened 9 months ago

lud commented 9 months ago

Context

I don't see if this is possible at the moment, but I think no.

Describe your suggested feature

In messageease, on the top-left square of the 9-grid, there is a © character that will enable combinations of letters.

So for instance cc© becomes ç, <<© becomes «, etc..

There are a lot, for instance I could do the "lambda" symbol for maths, but I can't remember the invocation. I cannot find the list of all possible combinations.

Would you consider implementing this feature?

Other details

No response

Acknowledgements

slashdevslashurandom commented 9 months ago

This feature would be reminiscent of the "Compose key" that is available on Linux systems.

Here is a list of X11 dead key and compose key combinations (in this situation we are looking for those that include Multi_key).

The only difference is that, when using the Compose key, one is supposed to input it first and then type in the keys for the character, so Compose o c makes the copyright symbol, Compose a e makes æ, Compose ^ j makes ĵ, etc.

nightkr commented 9 months ago

Yeah, I'd like to support this, I'm just not sure we're the correct place to maintain that kind of mapping table. Maybe if we can yoink something from CLDR or X11...

slashdevslashurandom commented 9 months ago

For comparison, this is how the developers of Unexpected Keyboard do character composing -- seems like they just have a list of predefined characters for specific accents, and if that's unavailable, either plug in a composing character codepoint or return failure.

As for the X11 database, it's usually taken from the libX11 source codes. In the libX11 source code file, the /libX11-1.8/nls/en_US.UTF-8/Compose.pre file contains most of the compose key definitions (including ones for non-Latin languages).

nightkr commented 9 months ago

Note to self: https://www.unicode.org/versions/Unicode15.1.0/ch03.pdf#G30602

nightkr commented 9 months ago

Online link to the Xlib compose definition: https://gitlab.freedesktop.org/xorg/lib/libx11/-/blob/041b5291f0956c5cda5054be2981c0d02b009a4c/nls/iso8859-1/Compose.pre

Phidica commented 9 months ago

I'm not sure if this will be useful, but I thought I'd include it in the discussion for completeness. @lud mentioned not being able to find a table of all the combinations supported in MessagEase, but I found one in the "How To..." section in the app and include it at the bottom of this comment.

While I suppose that some of these (like the accented letters) might be covered by an external library that could be relied upon by Flickboard, I think that others (like the maths symbols, punctuation, and Greek letters) are custom to MessagEase. For instance to complete @lud's example, typing a capital lambda is done with L and A.

I don't particularly mind if the required combination changes, but I think it would be nifty to be able to type some of these symbols with Flickboard.

MessagEase table of special characters | Symbol | Description | Combination | | :-: | - | :-: | | ƒ | script f | f and / | | " | low double comma quote | , and , | | … | horizontal ellipsis | . and . | | † | dagger | + and \| | | ‡ | double dagger | + and + | | ‰ | per mille | % and % | | Š | upper s hacek | S and ^ | | Œ | uppercase oe | O and E | | ' | single open comma quote | < and ' | | ' | single close comma quote | > and ' | | " | double open comma quote | \` and \` | | " | double close comma quote | ´ and ´ | | – | en dash | n and - | | — | em dash | m and - | | ˜ | spacing tilde | ~ and - | | ™ | trademark | T and M | | š | lowercase s hacek | s and ^ | | œ | lowercase oe chr | o and e | | Ÿ | uppercase Y diaeresis | Y and ¨ | | ¡ | inverted exclamation | ! and / | | ¢ | cent sign | c and / | | £ | pound sterling | L and - | | ¤ | general currency sign | o and = | | ¥ | yen sign | Y and = | | ¦ | broken vertical bar | \| and - | | § | section sign | S and / | | © | copyright | c and o | | « | left angle quote, guillemotleft | < and < | | ¬ | not sign | - and \| | | ® | registered trademark | o and r | | ¯ | macron accent | - and ^ | | ± | plus or minus | + and - | | ∓ | minus or plus | - and + | | ♂ | male sign | o and > | | ♀ | female sign | o and + | | ² | superscript two | 2 and ^ | | ³ | superscript three | 3 and ^ | | µ | micro sign | m and u | | ¶ | paragraph sign | p and p | | ¹ | superscript one | 1 and ^ | | » | right angle quote, guillemotright | > and > | | ¼ | fraction one-fourth | 1 and 4 | | ½ | fraction one-half | 1 and 2 | | ¾ | fraction three-fourths | 3 and 4 | | ¿ | inverted question mark | ? and / | | × | multiply sign | x and x | | ÷ | division sign | - and : | | ⁿ | Superscript n | n and ^ | | Ω | Ohm sign | o and h | | ∂ | Partial Differential | p and d | | √ | Square root sign | s and q | | √ | Square root sign | r and 2 | | ∞ | Infinity sign | o and o | | ∫ | Integral sign | s and \ | | ≈ | Almost equal sign | ~ and = | | ≠ | Not equal sign | / and = | | ≤ | Less than or equal to | < and = | | ≥ | Greater than or equal to | > and = | | ₣ | French Franc Sign | f and f | | ₤ | Italian Lira Sign | l and r | | ₧ | Spanish Peseta Sign | p and z | | ‽ | Interrobang | ! and ? | | À | capital a, grave accent | A and \` | | Á | capital a, acute accent | A and ´ | |  | capital a, circumflex accent | A and ^ | | à | capital a, tilde | A and ~ | | Ä | capital a, dieresis/umlaut mark | A and ¨ | | Å | capital a, ring | A and ° | | Æ | capital ae diphthong (ligature) | A and E | | Ą | capital a, ogonek (ligature) | A and C | | Ç | capital C, cedilla | C and C | | Č | capital C with háček | C and ^ | | Ć | capital C , acute accent | C and ´ | | Ð | capital eth, icelandic | D and - | | Ď | capital D with háček | D and ^ | | È | capital E, grave accent | E and \` | | É | capital E, acute accent | E and ´ | | Ê | capital E, circumflex accent | E and ^ | | Ë | capital E, dieresis/umlaut mark | E and ¨ | | Ě | capital E with háček | E and ^ | | Ę | capital E, ogonek (ligature) | E and C | | Ė | capital E, dot (ligature) | E and . | | Ì | capital i, grave accent | I and \` | | Í | capital i, acute accent | I and ´ | | Î | capital i, circumflex accent | I and ^ | | Ï | capital i, dieresis/umlaut mark | I and ¨ | | Į | capital i, ogonek (ligature) | I and C | | İ | capital i, dotted (Turkish) | I and . | | ı | small i, dottles (Turkish) | i and . | | Ğ | capital G, breve (Turkish) | G and ~ | | ğ | small g, breve (Turkish) | g and ~ | | Ň | capital N with háček | N and ^ | | Ñ | capital n, tilde | N and ~ | | Ò | capital o, grave accent | O and \` | | Ó | capital o, acute accent | O and ´ | | Ô | capital o, circumflex accent | O and ^ | | Õ | capital o, tilde | O and ~ | | Ö | capital o, dieresis/umlautmark | O and ¨ | | Ő | capital o, double acute /umlautmark | O and " | | Ø | capital o, slash | O and / | | Ř | capital R with háček | R and ^ | | Ť | capital T with háček | T and ^ | | Ù | capital u, grave accent | U and \` | | Ú | capital u, acute accent | U and ´ | | Û | capital u, circumflex accent | U and ^ | | Ü | capital u, dieresis/umlautmark | U and ¨ | | Ů | capital U with ring | U and ° | | Ű | capital U, double acute /umlautmark | U and " | | Ų | capital U, ogonek (ligature) | U and C | | Ū | capital U, bar (ligature) | U and - | | Ŭ | capital U, breve (ligature) | U and U | | Ŭ | capital U, breve (ligature) | U and u | | Ý | capital y, acute accent | Y and ´ | | Ž | capital Z with háček | Z and ^ | | Þ | capital thorn, icelandic | I and P | | ß | small sharp s, german (sz ligature) | s and s | | à | small a, grave accent | a and \` | | á | small a, acute accent | a and ´ | | â | small a, circumflex accent | a and ^ | | ã | small a, tilde | a and ~ | | ä | small a, dieresis/umlaut mark | a and ¨ | | å | small a, ring | a and ° | | æ | small ae diphthong (ligature) | a and e | | ą | small a, ogonek (ligature) | a and c | | ç | small c, cedilla | c and c | | č | small c with háček | c and ^ | | ć | small c, acute accent | c and ´ | | ð | small eth, icelandic | d and - | | ď | small d with háček | d and ^ | | è | small e, grave accent | e and \` | | é | small e, acute accent | e and ´ | | ê | small e, circumflex accent | e and ^ | | ë | small e, dieresis/umlaut mark | e and ¨ | | ě | small e with háček | e and ^ | | ę | small e, ogonek (ligature) | e and c | | ė | small e, dot (ligature) | e and . | | ì | small i, grave accent | i and \` | | í | small i, acute accent | i and ´ | | î | small i, circumflex accent | i and ^ | | ï | small i, dieresis/umlaut mark | i and ¨ | | į | small i, ogonek (ligature) | i and c | | ň | small n with háček | n and ^ | | ñ | small n, tilde | n and ~ | | ò | small o, grave accent | o and \` | | ó | small o, acute accent | o and ´ | | ô | small o, circumflex accent | o and ^ | | õ | small o, tilde | o and ~ | | ő | small o, double acute /umlautmark | o and " | | ö | small o, dieresis/umlaut mark | o and ¨ | | ø | small o, slash | o and / | | ř | small r with háček | r and ^ | | ŝ | small s with háček | s and ^ | | Ŝ | Capital S with háček | S and ^ | | š | small s with caron | s and ˇ | | Š | Capital S with caron | S and ˇ | | ş | small s with cedilla | s and > | | Ş | Capital S with cedilla | S and > | | ţ | small t with cedilla | t and > | | Ţ | Capital T with cedilla | T and > | | ť | small t with háček | t and ^ | | ù | small u, grave accent | u and \` | | ú | small u, acute accent | u and ´ | | û | small u, circumflex accent | u and ^ | | ü | small u, dieresis/umlaut mark | u and ¨ | | ů | small u with ring | u and ° | | ű | small u, double acute /umlautmark | u and " | | ų | small u, ogonek (ligature) | u and c | | ū | small u, bar (ligature) | u and - | | ŭ | small U, breve (ligature) | u and U | | ŭ | small U, breve (ligature) | u and u | | ý | small y, acute accent | y and ´ | | ž | small z with háček | z and ^ | | þ | small thorn, icelandic | i and p | | ÿ | small y, dieresis/umlaut mark | y and ¨ | | Α | Uppercase Alpha | A and L | | Β | Uppercase Beta | B and E | | Γ | Uppercase Gamma | G and A | | Δ | Uppercase Delta | D and E | | Ε | Uppercase Epsilon | E and P | | Ζ | Uppercase Zeta | Z and E | | Η | Uppercase Eta | E and T | | Θ | Uppercase Theta | T and E | | Ι | Uppercase Iota | I and O | | Κ | uppercase Kappa | K and A | | Λ | uppercase Lambda | L and A | | Μ | uppercase Mu | M and U | | Ν | uppercase Nu | N and U | | Ξ | uppercase Xi | X and I | | Ο | uppercase Omicron | O and N | | Π | uppercase Pi | P and I | | Ρ | uppercase Rho | R and O | | Σ | uppercase Sigma | S and I | | Τ | uppercase Tau | T and A | | Υ | uppercase Upsilon | U and P | | Φ | uppercase Phi | P and H | | Χ | uppercase Chi | C and H | | Ψ | uppercase Psi | P and S | | Ω | uppercase Omega | O and M | | α | Lowercase Alpha | a and l | | β | Lowercase Beta | b and e | | γ | Lowercase Gamma | g and a | | δ | Lowercase Delta | d and e | | ε | Lowercase Epsilon | e and p | | ζ | Lowercase Zeta | z and e | | η | Lowercase Eta | e and t | | θ | Lowercase Theta | t and e | | ι | Lowercase Iota | i and o | | κ | Lowercase Kappa | k and a | | λ | Lowercase Lambda | l and a | | μ | Lowercase Mu | m and u | | ν | Lowercase Nu | n and u | | ξ | Lowercase Xi | x and i | | ο | Lowercase Omicron | o and n | | π | Lowercase Pi | p and i | | ρ | Lowercase Rho | r and o | | ς | Lowercase Final Sigma | f and s | | σ | Lowercase Sigma | s and i | | τ | Lowercase Tau | t and a | | υ | Lowercase Upsilon | u and p | | φ | Lowercase Phi | p and h | | χ | Lowercase Chi | c and h | | ψ | Lowercase Psi | p and s | | ω | Lowercase Omega | o and m |
lverweijen commented 9 months ago

I know that vim and emacs use RFC1345 (with their own modifications) for making special characters, which has a lot of symbols.

It does have a few downsides that you may want to think about:

nightkr commented 9 months ago

@lverweijen

Yeah, hm.. that's a pretty big downside. But we can always make the source an option or something, and as you say it doesn't have to be the only way to enter characters.

@Phidica

Thanks for the list! Looking at it, it seems like there are basically two different "patterns" going on: "Character with accent" (a¨ -> ä) and "smash these two regular characters together" (ae -> æ). I think, ideally, the former should hopefully already be solved by dead letters/zalgo mode, so the latter is probably what I'd focus on for this.

MilesBHuff commented 1 month ago

Here's the info from #238, so that it doesn't get lost:

In Messagease, the ‹A› button's top-left swipe combines or changes characters to be special versions of themselves.

Of particular note is the ability to type Greek letters by typing (typically) the first two letters of their names, followed by this special key. Example: m + u + C == µ. Greek letters are useful when typing certain things, like some mathematical constants (φ, τ) or physics terms (Δ, γ radiation) or medical terms (5α-reductase, ERβ), or for units involving the "micro" prefix (µs).

Also of note is the ability to type several special characters that are not otherwise possible to type on the keyboard. Some examples: ð, æ, ç, œ, ø, ß. ‹ç› and ‹œ› are essential when typing French (which is something I occasionally do); ‹ß› for typing German (also something I occasionally do); ‹ø› for Norwegian (which is on my list to learn); ‹æ› for Norwegian, Old English, and others; ‹æ›+‹œ› for fancy Latin and pretentious English (ex: encyclopædia); ‹Ð›/‹ð› for Old English and Norse (Messagease, sadly, lacks Thorn.); etc. These are also handy to have for IPA.

Atm, these letters are, to my knowledge, inaccessible to me on Flickboard, but I was able to type all of this on the English Messagease keyboard.

In addition to typing "xC" to get these characters (which can require multiple Cs), some can be yielded more-directly: ‹ø› can be typed as "o/C", ‹æ› as "aeC", ‹œ› as "oeC", ‹ç› as "ccC".

The way I would suggest implementing this button for FlickBoard, is to only implement mutations for two-letter combinations and the 26 standard Latin letters. Example of what I mean: Messagease cycles various special characters when C is pressed on a litany of arbitrary letters. "cC" is ‹¢›, "¢C" is ‹©›, "©C" is ‹č›, and so-on. It would be much simpler if there were only one level of C for each of the 26 letters, leaving additional special characters to be yielded via digraphs. "coC", for example, yields ‹©›, thus making "¢C" unnecessary.

Here is a full list of what I would like for single letter substitutions: (I call out any deviations from Messagease's setup, but I don't call out omissions.)

  • c>¢

  • d>ð/D>Ð (instead of d>ď>ð/D>Ď>Ð)

  • f>ƒ

  • F>₣ (instead of f>ƒ>₣)

  • i>ı (instead of i>ǐ>ı)

  • I>İ (instead of I>Ǐ>İ)

  • l>ł/L>Ł (new substitution; needed for Polish)

  • o>¤/O>¤ (instead of o>œ>¤)

  • p>¶/P>¶ (capital version is new)

  • s>ſ (new substitution; needed for typing archaïcally)

  • S>§

  • t>þ/T>Þ (new substitutions; needed for Icelandic, Old English, Old Norse, and some related languages)

And for digraphs:

  • aa>å (new digraph, alternative to a°>å)

  • ae>æ/AE>Æ

  • cc>ç/CC>Ç

  • c,>ç/C,>Ç (new digraphs, alternative to cc>ç)

  • co>©/CO>© (capitalized version is new)

  • d'>ď (replaces d>ď)

  • l'>ľ (replaces l>ľ)

  • oe>œ/OE>Œ

  • oo>∞

  • o/>ø & O/>Ø

  • 0/>Ø (I think that's the empty set, not Norwegian/Danish ‹Ö›) (new digraph, replaces h-down-up)

  • pt>₧/Pt>₧ (new digraphs, replaces p>¶>₧)

  • ro>®/RO>® (instead of ro>ρ/RO>Ρ and O>Œ>®)

  • ss>ß

  • sh>∫ (new digraph, replaces s>š>ş>ŝ>ß>∫)

  • s,>ş/S,>Ş (new digraphs, replaces s>š>ş)

  • t'>ť (new digraph, replaces t>ť)

  • t,>ţ/T>Ţ (new digraphs, replaces t>ť>ţ/T>™>Ť>Ţ)

  • tm>™/TM>™ (new digraphs, replaces T>™)

Plus all the digraphs needed for the Greek letters. All except the following are just the first two letters of their names (capitalized for capitals):

  • ON/on>Ο/ο (Omicron, to avoid ambiguïty with Omega; same as Messagease)

  • Messagease used ro>ρ/RO>Ρ instead of rh/RH; recommend using rh/RH to avoid inconsistencies between RO>®/CO>©.

The C button, when pressed, would first try to match a digraph. If a match is found, it replaces the digraph with the new character. If the match is not found, it tries to match a single letter transformation. If a match is found, it replaces the letter with its special form. If no match is found, C does nothing.

There are many substitutions I would like to add (particularly in regards to the IPA, which would be amazeballs to be able to type), but I kept this post limited to those special characters that Messagease can already type with its C key, plus ł/Ł and þ/Þ (painful omissions).

I didn't know about the Zalgo key when I wrote the above. I wrote the below after learning about it:

It is much slower to stretch all the way over to the Zalgo key, and missing it means hitting the home key or the app switcher (depending on the horizontal position of the keyboard).

The compose key on Messagease is quite fast and comfortable to hit because it's on one of the 9 main keys. So food for thought I guess. I do linguistics and end-up using that key a fair bit sometimes. Would prefer if the Zalgo key were similarly accessible.