- the main thought I'm having is that
one feature we want to add to Dasher, is the ability to revert back to
a non-Dasher (i.e. standard keyboard) IME for entering data into
certain kinds of fields: e.g. passwords, possibly even web addresses
(where the standard language model we have isn't all that great!). So
really we'd like to come up with a framework that lets us do both of
these things together - i.e. it seems more than reasonable to make the
fallback keyboard interface be Tekla....
Thus, I'm seeing a few options:
*One way is to have a "main" IME, that stays in charge, with the
ability to fall-back to an alternative IME under certain conditions.
So we specify some kind of Intent, posted by the main IME to the
secondary one, that "the next time you get activated, it should be
only temporary". Then, when the user enters a text field, or whatever,
such that the secondary IME is wanted, the main IME notifies the
second one with this Intent, and then makes the second one the active
input method via InputMethodManager (as we have to, I think).
The secondary IME, upon receiving such an intent, records that the
next time it becomes active, this should only be temporary; and
immediately input finishes, it reactivates (via InputMethodManager)
the primary one again.
The problem I can see here, tho, is detecting when input has finished:
the onFinishInput method that's supposed to be called by Android is,
in my experience, often called a lot later than it seems it should be.
(Switching to another field tends to call onStartInput rather more
promptly, IIRC, but this doesn't help in all cases!)...
*A second way is a more co-operative approach. We have Preferences in
Dasher, "use Tekla for XYZ", and Preferences in Tekla, "use Dasher for
UVW"; whenever either IME is activated under those conditions, it
transfers control to the other using InputMethodManager, and*hopes*
that the other will transfer control back appropriately (i.e. that the
inverse preferences are set there).
An enhancement might be to transmit intents between the two when
either's preferences are changed, to keep the other's preferences in
sync.
*A third way, and I'm not sure how practical/different this would be,
is to make both Tekla and Dasher_not_ be input methods, but somehow
be activated/called by a single "Overseer" IME. (Or indeed, to make
either libraries, in some way that lets them be called by the other,
or something like that). This might solve a lot of problems, but OTOH
I'm not sure whether the necessary architecture for this exists in
android, would have to look into it...
Hmmm. Ok, your turn;-). I'm wondering if you've been thinking about
this more than me, I've been concentrating on a couple other things of
late...
Cheers, Alan