XForms: Testing to see if a key is released

From: Reed Riddle (drriddle@qwest.net)
Date: Tue May 27 2003 - 23:30:27 EDT

  • Next message: Angus Leeming: "Re: XForms: Testing to see if a key is released"

    # To subscribers of the xforms list from "Reed Riddle" <drriddle@qwest.net> :

    Hi folks,

    I'm building an application with an interactive xyplot, and one of the
    things I do is allow the user to move from point to point in the plot
    with the arrow keys. This works just fine with a handler routine,
    except if the user holds the key down; when they do that, the selected
    point keeps moving after the key is released. I also allow the user to
    use the mouse for selecting points, but the people who will use this
    software are stubborn and want to hold the key down and scroll through
    the points. Damn them anyways... ;)

    So, what I need is something that will check if a key on the keyboard
    is released. If the key is released, then I want to ignore all the
    keyboard events in the queue. I am completely an X novice, so please
    don't tell me to flush the Xevent queue, it will be lost on me. :)
    The program is processing Xevents fast enough that I can just ignore
    the extra key presses; I just need a way to test if the key is pressed
    still before I do the operation.

    Thanks for any and all help!

                                            Reed

    ----------------------------------------------------------------------
    Dr. Reed L. Riddle
    Associate Director of Whole Earth Telescope Operations
    Iowa State University Department of Physics & Astronomy
    Email: drriddle@qwest.net
    Homepage: http://www3.iitap.iastate.edu/~riddle/

    "This life has been a test. If it had been an actual life, you would
      have received actual instructions on where to go and what to do."
                                     -- Angela Chase, "My so-called life"

    _________________________________________________
    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/
    Development: http://savannah.nongnu.org/files/?group=xforms



    This archive was generated by hypermail 2b29 : Tue May 27 2003 - 23:31:47 EDT