Questions and thoughts about input method protocol

Bill Spitzak spitzak at gmail.com
Tue Feb 5 10:29:42 PST 2013


On 02/04/2013 11:20 PM, Daniel Stone wrote:

> What? Compose keys in X can only be implemented through input methods.
>   GTK+ does it using its own internal input method (which is more than
> capable of doing pre-edit, what with it being part of core GTK+ and
> all), but xterm and all the other core apps just do it through the
> default XIM.  There is no 'keyboard api' with composition, full stop.
>   It's all input method.

Okay I think I was confused in that calls that don't have "IM" in their 
names are part of the "input method?". In any case this is what xev 
gives me when I type compose,a,e:

KeyRelease event, serial 36, synthetic NO, window 0x3c00001,
     root 0x26a, subw 0x0, time 26536729, (89,110), root:(1370,218),
     state 0x0, keycode 105 (keysym 0xff20, Multi_key), same_screen YES,
     XLookupString gives 0 bytes:
     XFilterEvent returns: False

KeyPress event, serial 36, synthetic NO, window 0x3c00001,
     root 0x26a, subw 0x0, time 26537465, (89,110), root:(1370,218),
     state 0x0, keycode 38 (keysym 0x61, a), same_screen YES,
     XLookupString gives 1 bytes: (61) "a"
     XmbLookupString gives 1 bytes: (61) "a"
     XFilterEvent returns: True

KeyRelease event, serial 36, synthetic NO, window 0x3c00001,
     root 0x26a, subw 0x0, time 26537616, (89,110), root:(1370,218),
     state 0x0, keycode 38 (keysym 0x61, a), same_screen YES,
     XLookupString gives 1 bytes: (61) "a"
     XFilterEvent returns: False

KeyPress event, serial 36, synthetic NO, window 0x3c00001,
     root 0x26a, subw 0x0, time 26538060, (89,110), root:(1370,218),
     state 0x0, keycode 26 (keysym 0x65, e), same_screen YES,
     XLookupString gives 1 bytes: (65) "e"
     XmbLookupString gives 1 bytes: (65) "e"
     XFilterEvent returns: True

KeyPress event, serial 36, synthetic NO, window 0x3c00001,
     root 0x26a, subw 0x0, time 26538060, (89,110), root:(1370,218),
     state 0x0, keycode 0 (keysym 0xe6, ae), same_screen YES,
     XLookupString gives 0 bytes:
     XmbLookupString gives 2 bytes: (c3 a6) "æ"
     XFilterEvent returns: False

I thought XmbLookupString and XFilterEvent were part of the XKB library, 
not part of the IM library. If I was wrong, sorry about that.

In any case I would very much like to see a compose-key api with preedit 
showing an indication as to what letters you typed, installed by default 
on Wayland for western locales. First this would make it easier to use 
compose keys, second it would force programs to correctly implement preedit.



More information about the wayland-devel mailing list