Implement a common manager for composing input methods
See original GitHub issueMany input methods requires multiple inputs to compose a character, for example, Telex for Vietnamese (#183), Indic scripts (#368) or Korean (#305). Therefore, it could be helpful to have a common manager for them that reads from a config file. Each row in the config file represent a transformation rule, with the LHS being the sequence of keys pressed and the RHS is the output character.
For example, config for Telex can look like:
{
"_depth": 2,
"aa": "â",
"as": "á",
"âs": "ấ",
"..."
}
I suppose we can use getTextBeforeCursor and setComposingText to implement this. Here is a pseudocode of how I think I would implement it:
fun onKeyPressed(pressedKey: Char, config: Json) {
depth = config["_depth"]
pattern = getTextBeforeCursor(depth - 1) + pressedKey
if pattern is a key in config {
replacedText = composingText.replace(pattern, config[pattern])
setComposingText(replacedText)
}
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (11 by maintainers)
Top Results From Across the Web
Create an input method - Android Developers
Create an input method ... An input method editor (IME) is a user control that enables users to enter text. Android provides an...
Read more >Chapter 7. Smart Common Input Method
Red Hat Enterprise Linux 5 utilizes the Smart Common Input Method (SCIM) platform to provide a user friendly interface from which you can...
Read more >Programming Input Methods
The input method is a programming interface that allows applications to run in an international environment provided through National Language Support (NLS).
Read more >Compose specification - Docker Documentation
A Compose implementation to parse a Compose file using unsupported attributes ... options to tweak volume management according to the actual infrastructure.
Read more >Developing Custom Gradle Plugins
Then we will look at creating a standalone project. Writing a simple plugin. To create a Gradle plugin, you need to write a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Teaser n°2… https://user-images.githubusercontent.com/7904776/117855172-8619c980-b28a-11eb-8af5-d563fbf94c05.mp4
More seriously once again, I got things to work I think? Note that the hiragana support in the video is incomplete and its only goal was to test the code that uses json rules.
Things that still need work:
Impressive work, really liking the direction this is going!
That’s something what happens to me too, but in most cases this is something I fix after the core changes are in. Doc strings are important for other contributors to better understand what the code does, so it should be updated if possible.
Yes it is best if the composer selection is right below the language dropdown in the Settings Dialog UI, like also in the JSON syntax.
This indeed looks a bit weird. For now let’s leave it in there, when your code base is fully ready we will see if we can improve on that specific line.
Subtypes are only identical if a. the language, b. all the layouts, and c. the currency set matches
Meaning the same logic also applies for the composer once added to the subtype specification: one could have the same config for language/curr.set/layouts and as long as there are two different composers selected this shouldn’t cause any trouble. The list item summary string in the subtype list UI might need a rework to better reflect what each subtype represents, else it is of course a bit difficult to see the difference between the two.
Suggestions for this summary string:
<character layout name> | <composer name> | <currency set name>
<character layout name> | <composer name>
<character layout name> | <currency set name>
What exactly fits best is a bit trial and error until something best matching has been found.