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

From: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
Date: Mon, 25 May 2015 09:23:12 +0200

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,
Received on Mon May 25 2015 - 09:23:12 CEST

This archive was generated by hypermail 2.3.0 : Mon May 25 2015 - 09:24:08 CEST