XForms: FL_KEY_ALL

From: Angus Leeming (a.leeming@ic.ac.uk)
Date: Fri Dec 06 2002 - 13:59:15 EST

  • Next message: Steve Lamont: "Re: XForms: problem with fl_set_idle_delta in 1.0 RC 5.2"

    # To subscribers of the xforms list from Angus Leeming <a.leeming@ic.ac.uk> :

    Hello Steve et al.,

    I have a question about keyboard handling.

    In forms.c's do_keyboard, the keysym is calculated as I'd expect:
            kbuflen = fl_XLookupString((XKeyEvent *) xev, (char *) keybuf,
                                       sizeof(keybuf), &keysym);

    But then you do some magic

                else {

                    unsigned char *ch;

                    /* all regular keys, including mapped strings */
                    for (ch = keybuf; ch < (keybuf + kbuflen) && keyform; ch++) {
                        if (formevent == FL_KEYPRESS)
                            fprintf(stderr, "do_keyboard %d %d\n", *ch, keysym);
                        fl_handle_form(keyform, formevent, *ch, xev);
                    }

    Ie, the keysym is effectively ignored and keybuf is fed to fl_handle_form,
    char by char. (How you'd get more than one char beats me, but that's another
    question.)

    I can see why it's done like this. fl_keyboard relies on this to decypher the
    input in the built-in xforms widgets.

    However, I have a home-made widget with obj->wantkey = FL_KEY_ALL and I want
    keysym!

    Am I missing the point of FL_KEY_ALL? Shouldn't I expect xforms to pass me
    the unadulterated keysym if I have this var set? Ie

            if (wantkey == FL_KEY_ALL)
                    fl_handle_form(keyform, formevent, keysym, xev);
            else
                    all this magic

    Any chance of some illumination?
    Angus
    _________________________________________________
    To unsubscribe, send the message "unsubscribe" to
    xforms-request@bob.usuhs.mil or see
    http://bob.usuhs.mil/mailserv/xforms.html
    XForms Home Page: http://world.std.com/~xforms
    List Archive: http://bob.usuhs.mil/mailserv/list-archives/



    This archive was generated by hypermail 2b29 : Fri Dec 06 2002 - 13:52:36 EST