handling mouse input

New Message Reply Date view Thread view Subject view Author view

From: Frans van Hoesel (F.H.J.van.Hoesel++at++chem.rug.nl)
Date: 02/22/2002 02:42:29


Hi,

somehow calling pfuGetMouse returns the current mouse
coordinates, but the old mouse-button status.
What am I doing wrong? or is this the expected behaviour?

Pice of my code is:
void mycallback(int dev, void *val, pfuCustomEvent *pfuevent) {
    pfuGetMouse( &(ViewState->mouse));
    fprintf(stderr, "mycallback called; mouseflags %x click %x, mods %x\n",
        ViewState->mouse.flags , ViewState->mouse.click,
        ViewState->mouse.modifiers);
    ViewState->picker->doPick( ViewState->mouse.xpos, ViewState->mouse.ypos);
}

And in the main.C (from perfly source in the 'common' directory)
I have:
     pfuInputHandler(mycallback, ButtonPressMask );

One thing that is strange is that it also reacts to mousebutton releases!
When the button is pressed mouseflags is always 0, but with the correct
coordinates. when the button is released, mouseflags is something like
1801, 1802 or 1804 (depending on the button just released)
I would like to know which buttons are pressed the moment they are pressed,
not when they are released.
What to do?

-frans

  _______________________________________________________________

    "Hi, my name is Frans, I'm your crazy scientist for today."

    Frans van Hoesel hoesel++at++chem.rug.nl
                              http://hpcv100.rc.rug.nl/~hoesel
  _______________________________________________________________


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Fri Feb 22 2002 - 02:43:55 PST

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.