Comment 25 for bug 601816

Revision history for this message
David Schneider (dnschneid) wrote :

After a bunch of searching about poking at the IMContext and turning up nothing, I took a wild stab and told the keypress event to always return false.
And ibus worked.

Some more debugging and it turns out that for whatever reason, ibus generates an extra keypress event for each letter pressed. The second event is caught by the "held key" detection feature of Kupfer (for launching default actions) and is getting swallowed.

Printing out keypress events, it looks like this:
Under uim:
<gtk.gdk.Event at 0xa78eb30: GDK_KEY_PRESS keyval=a>
<gtk.gdk.Event at 0xa78e560: GDK_KEY_PRESS keyval=s>
<gtk.gdk.Event at 0xa6e0338: GDK_KEY_PRESS keyval=d>
<gtk.gdk.Event at 0xa6e0e18: GDK_KEY_PRESS keyval=f>

Under ibus:
<gtk.gdk.Event at 0xa6e0e18: GDK_KEY_PRESS keyval=d>
<gtk.gdk.Event at 0xa6e0e18: GDK_KEY_PRESS keyval=d>
<gtk.gdk.Event at 0xa597f80: GDK_KEY_PRESS keyval=j>
<gtk.gdk.Event at 0xa597f80: GDK_KEY_PRESS keyval=j>
<gtk.gdk.Event at 0xa78e830: GDK_KEY_PRESS keyval=n>
<gtk.gdk.Event at 0xa597f80: GDK_KEY_PRESS keyval=n>

So basically, disabling repeat detection (under the "# activate on repeated key" comment) fixes ibus.
I'll see if I can figure out a heuristic so that both ibus and the repeat key feature works.