On Sunday 02 February 2003 4:22 pm, [EMAIL PROTECTED] wrote:
> On Sun, 2 Feb 2003, Angus Leeming wrote:
> > Sure. Presumably related to that missing psuedo-code in input.c
> >
> > >       if (sp->CJK_composition_on && keysym)
> > >               Turn_off_composition_Insert_composed_char_and
> >
> > Increment_position_by_one();
>
> I thought you refer this to
>
> "turn_on(off)_local_input(ob)" in input.c. But it does not look the same.
>
> The code you gave me was that in handle_key(ob,key,kmask) in input.c,
> "....................
> .....................
>     /* toggle input method for CJK users */
>     if (key == XK_space) {
>         int input_method_toggled=0;
>         if (shiftkey_down(kmask) && !sp->CJK_local_input) {
>             input_method_toggled=1;
>             turn_on_local_input(ob);
>         }else if (!shiftkey_down(kmask) && sp->CJK_local_input) {
>             input_method_toggled=1;
>             turn_off_local_input(ob);
>         }
>         /* If we have simply toggled the input method, then
>            don't output the  XK_space */
>         if (input_method_toggled)
>             return 0;
>     }
> ..................................
> ................................
>
> Am I missing something here or do you refer to something else?

No, you are not missing anything. I was refering to this code.

> By the way, a quick test shows that this code does not affect the
> precomposition point. That is, the keyboard signal does not go through
> this part ("turn_on_local_input(ob);") of the codes.

Then you have to:

1. Check that 'Shift-Space' is passed to input.c.

2. Refine your test inside input.c:
        printf("XK_space %d, key %d, CJK_li %d, shift %d\n",
                XK_space, key, sp->CJK_local_input, shiftkey_down(kmask));

        /* Turn on CJK composition */
        if (key == XK_space && shiftkey_down(kmask) && !sp->CJK_local_input) {
                printf("Turning composition on!\n");
                turn_on_local_input(ob);
                /* Do not actually print the XK_space. */
                return 0;
        }

        /* Turn off CJK composition */
        if (key && sp->CJK_local_input) {
                printf("Turning composition off!\n");
                printf("key = %d, keybuf = %s\n", key, keybuf);
                turn_off_local_input(ob);

                /* Presumably the contents of keybuf should be passed
                   to the code below for printing?
                */
        }

Incidentally, perhaps you should rename your variables and functions now that 
I (start to) understand what is going on
        CJK_local_input -> CJK_composing
        turn_on_local_input -> activate_CJK_composition
        turn_off_local_input -> deactivate_CJK_composition

--- 
Angus

Reply via email to