Input method and input/output redirect under wayland

Bill Spitzak spitzak at gmail.com
Thu Aug 30 11:16:26 PDT 2012



Michael Hasselmann wrote:

>> For some input method (especially for CJK), it is important to have
>> some user interaction before some text is finally committed (e.g.
>> there might be more than one candidate words for a single input
>> string), and for better user experience, it is important to show this
>> window (for user interaction) closed to the cursor and in a way
>> consistent with the input window.
> 
> Yes, pre-edit support. Work in progress.

I think he is asking for the ability of the input method to draw an 
arbitrary overlay, for instance a popup menu of possible completions.

If it is truly arbitrary then the input method will have to draw it. But 
then it is going to need full information about the position of the 
cursor and the selected text, what the transformation is, what the font 
is, and probably a lot more stuff I can't imagine yet. It would be 
excessively complicated.

Can it instead be limited to a list of pre-edit texts? Then it can be 
drawn by the client, which would be able to reuse it's own popup menu 
code, and blend perfectly into the text display by using the right font 
and transformation. As I imagine it:

1. The input method sends the client a list of preedit texts, plus an 
indicator of which one is "current". The client then must present this 
list and provide an api so the user can choose one with the pointer.

2. Input method can, in response to any event, change the list or 
dismiss it. The input method may use text keystrokes to change the 
selected item (for instance if the user types the first letter of one it 
is the input method that moves to that one). This is because the 
selection text may not be determinable from the preedit text.

3. Client can use pointer events and non-text keystrokes that the input 
method ignores to choose an item. It can then send an event to the input 
method indicating which one was chosen or that the user dismissed the menu.

I believe this will result in much cleaner and correct display of these 
menus. The problem is that the display is going to be limited to simple 
lists of text. Is this ok?


More information about the wayland-devel mailing list