Re: [info-performer] Window focus

Date view Thread view Subject view Author view

From: Paolo Farinelli (paolo++at++sgi.com)
Date: 05/19/2003 19:06:01


Hi Tiziano,

if you use libpfutil for collecting mouse and keyboard input, you
can look at the value of the 'inWin' parameter inside the pfuMouse
structure.

When mouse is over a Performer pipewindow (pwin), this variable
should contain the same value that is returned by pwin->getWSWindow();

Eg:

/* do this once. Make sure you get non-NULL values...
     You may have to call pfFrame once or twice before
      you do this.. */

    for( loop=0; loop<NumWins; loop++ )
    {
         XWin[loop] = pwin[loop]->getWSWindow();
    }

/* do this on every frame to figure out which window has focus */

    pfuMouse mouse;
    pfuGetMouse(&mouse);
           
    int winIndex = -1;
    for(loop=0; loop<NumWins; loop++ )
    {
        if(XWin[loop] == mouse.inWin )
        {
            winIndex = loop;
             break;
        }
    }

You may also take a look at the various classes implemented within libpfv:
the pfvDisplayManager and pfvInputManager include some methods to
properly dealing with multiple pipewindows..

eg: pfvInputMngr::getFocusPWinIndex

Hope this helps.

Buon Lavoro,
Paolo

titius++at++libero.it wrote:

>Hello,
>I'd like to know is there's a way to know if a Pfwindow
>has focus in a certain moment or not.
>Thanks.
>
>Tiziano Diamanti
>
>-----------------------------------------------------------------------
> List Archives, Info, FAQ: http://www.sgi.com/software/performer/
> Open Development Project: http://oss.sgi.com/projects/performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com
>-----------------------------------------------------------------------
>

-- 
Paolo Farinelli                                           paolo++at++sgi.com
Member of Technical Staff, OpenGL Performer              1-650-933-1808
Silicon Graphics        1600 Amphitheatre Pkwy, Mountain View, CA 94043


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Mon May 19 2003 - 19:06:12 PDT