pfuInputHandler usage

New Message Reply Date view Thread view Subject view Author view

AnitaKishore (kishore++at++electrogig.com)
Mon, 7 Aug 1995 16:27:10 -0700


Greetings everyone:

The following question is directed towards Performer 2.0 Beta users.

        Can someone tell me how to use pfuInputHandler function to register
my own X event handler for a window. I want to be able to call my function
whenever say a mouse button press event occurs. I have tried checking this
through a variable of type pfuMouse - which is supposed to contain info on
which mouse button pressed in its "flags" field. But this field is always
0 every frame for any mouse button pressed. So I thought of doing this by
registering my own event handler. The current code is as follows:

    pfInit();
    pfConfig();
    pfuInitUtil();

    // read an appropriate data file and make the scene graph
    - - - - - -

    p = pfGetPipe(0);
    pw = pfNewPWin(p);
    pfPWinType(pw, PFWIN_TYPE_X);
    pfPWinName(pw, "IRIS Performer");
    pfPWinOriginSize(pw, 100, 100, 720, 486);
    pfOpenPWin(pw);

    // create channel
    - - - - - - -

    pfuInitInput(pw, PFUINPUT_X);

    for (;;)
    {
        pfSync();
          pfFrame();
        postFrame(pw);
    }

where postFrame is:

void postFrame(pfPipeWindow *pw)
{
    pfuMouse mouse;
    pfuGetMouse(&mouse);
    printf("mouse at (%d , %d)\n", mouse.clickDownX, mouse.clickDownY);
    if (mouse.flags == PFUDEV_MOUSE_LEFT_DOWN)
        printf("PFUDEV_MOUSE_LEFT_DOWN\n");
}

The mouse's position is printed but not the flags information.
What is the correct way of using these functions?

Thanks for any input.

-anita

----------------------------------------------------------------------------
Anita Kishore
kishore++at++electrogig.com
----------------------------------------------------------------------------


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:51:45 PDT

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