Re: [dev] [st] Fcitx not working in st

From: Ivan Tham <ivanthamjunhoe_AT_gmail.com>
Date: Tue, 30 Jun 2015 22:51:55 +0800

Thanks. But I am not very good at c. I had contact the fcitx developer
named Weng Xuetian which had once help in writing st. He said that he
had fixed a problem a long time ago in commit 84ceefe08. Look at:

http://git.suckless.org/st/commit/?id=84ceefe0890ee235dd736543fe30479393562fb6

Any idea how to fix that?

On Mon, May 25, 2015 at 09:23:12AM +0200, Roberto E. Vargas Caballero wrote:
>Hi,
>
>On Sat, May 23, 2015 at 03:43:08PM +0800, Ivan Tham wrote:
>> >>I typed ``Ctrl + Space`` in st but it seems like it doesn't work. Fcitx
>> >>is a Chinese IME for XIM.
>> >
>> >As far as I know no IME works with st (please correct me if I am
>
>St has code to deal with input methods. I cannot test it because
>I am not user of such methods, but the code that deals with XIM is:
>
>xinit():
> /* input methods */
> if((xw.xim = XOpenIM(xw.dpy, NULL, NULL, NULL)) == NULL) {
> XSetLocaleModifiers("_AT_im=local");
> if((xw.xim = XOpenIM(xw.dpy, NULL, NULL, NULL)) == NULL) {
> XSetLocaleModifiers("_AT_im=");
> if((xw.xim = XOpenIM(xw.dpy,
> NULL, NULL, NULL)) == NULL) {
> die("XOpenIM failed. Could not open input"
> " device.\n");
> }
> }
> }
> xw.xic = XCreateIC(xw.xim, XNInputStyle, XIMPreeditNothing
> | XIMStatusNothing, XNClientWindow, xw.win,
> XNFocusWindow, xw.win, NULL);
> if(xw.xic == NULL)
> die("XCreateIC failed. Could not obtain input method.\n");
>
>----------------------------------------------------------------------------
>void
>focus(XEvent *ev) {
> XFocusChangeEvent *e = &ev->xfocus;
>
> if(e->mode == NotifyGrab)
> return;
>
> if(ev->type == FocusIn) {
> XSetICFocus(xw.xic);
> xw.state |= WIN_FOCUSED;
> xseturgency(0);
> if(IS_SET(MODE_FOCUS))
> ttywrite("\033[I", 3);
> } else {
> XUnsetICFocus(xw.xic);
> xw.state &= ~WIN_FOCUSED;
> if(IS_SET(MODE_FOCUS))
> ttywrite("\033[O", 3);
> }
>}
>
>-----------------------------------------------------------------------------
>kpress():
> len = XmbLookupString(xw.xic, e, buf, sizeof buf, &ksym, &status);
> /* 1. shortcuts */
> for(bp = shortcuts; bp < shortcuts + LEN(shortcuts); bp++) {
> if(ksym == bp->keysym && match(bp->mod, e->state)) {
> bp->func(&(bp->arg));
> return;
> }
> }
>-----------------------------------------------------------------------------
>
>> >having trouble figuring out where to start (Is it a X text protocol?
>> >It probably is with XIM but not with ibus. Would I have to use an ibus
>> >API to get st to work with ibus? Etc...).
>
>So I think it should work. With this information you can debug the issue.
>
>
>Regards,
>
>
>

-- 
 _____________________________________
< Do what you like, like what you do. >
 -------------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||



Received on Tue Jun 30 2015 - 16:51:55 CEST

This archive was generated by hypermail 2.3.0 : Tue Jun 30 2015 - 17:00:11 CEST