In-client echo of input methods?

Jan Arne Petersen jpetersen at
Tue Aug 14 23:38:28 PDT 2012


On 08/15/2012 02:45 AM, Bill Spitzak wrote:
> Does the proposed input methods support clients being able to show
> intermediate results? This is certainly useful to make "dead keys" less
> "dead", and I am under the impression that it is very useful for some
> Asian entry systems.

Yes, that will be supported (pre-edit).

> X11 tried to do this with an input-method-controlled overlay, but this
> was incredibly complex and messy and did not really work. I think
> however that the clients can draw this, and often it will be trivial to
> support it.

Yes, every important toolkit (Gtk+, Qt, EFL) supports in place pre-edit
in the Text control nowadays (the pre-edit text is usually underlined).
Wayland will rely on in place pre-edit in the clients.

> Assuming there is an input method doing compose-key, here is what I
> would expect to happen if the user types compose,a,e to make æ:
> 1. User presses & releases compose key.
> 2. User types 'a'. Input method then sends 'a' to the client. Client
> inserts it into the text as though the user typed it, but remembers it
> came from the input method. This gives the user a preview of what they
> typed, which I have found to be much better than normal "dead key"
> behavior.

The client gets a preedit("a") event

> 3. User types 'e'. Input method sends a message to replace the previous
> input with 'æ'. The client then deletes the 'a' and inserts the 'æ'.

The client gets a commit("æ") event

> If at step 3 the user typed 'x' (and assuming ax is not a compose
> sequence) the input method could then choose how to handle the error:
>   1. Input method says to also insert an 'x', resulting in "ax" (my
> preference).

The client would get a commit("ax") event

>   2. Input method says to replace the previous input with 'x'.

The client would get a commit("x") event

>   3. Input method says to replace the previous input with nothing
> (matching what X11 compose key does).

The client would get a commit("") event

> Is there anything like this in wayland's input method design?

Yes it is planned.

Jan Arne

More information about the wayland-devel mailing list