Release the mouse

martinw

21-05-2007 09:05:14

Hi,

Does anyone know the easiest way to disable the mouse control in the OgreNewt examples, so I can run OgreNewt in a windows' window and use the mouse in another window at the same time (aswell as on the desktop)?

I've had a look in the ExampleApplication.h but there seems to be a lot of places it's used, mentioned, set e.t.c.

Thanks,

Martin

Game_Ender

21-05-2007 15:44:05

I believe that is OIS related, so you want to have a look at any OIS related sections of code.

martinw

22-05-2007 11:43:57

Thanks Game_Ender

In ExampleFrameListener.h below:

ParamList pl;

I put:

pl.insert(std::make_pair(std::string("w32_mouse"),std::string("DISCL_FOREGROUND")));
pl.insert(std::make_pair(std::string("w32_mouse"),std::string("DISCL_NONEXCLUSIVE")));


From the wiki; which worked fine :D, but now when the window loses focus Ogre stops :?

Does anyone know how to make Ogre keep running when it loses focus?

I'll have a look around on the Ogre site too.

Martin

martinw

22-05-2007 16:57:54

I've worked it out but I'm not too happy about how to do it.

I've had to change the code in OgreMain :shock:

In OgreWindowEventUtilities.cpp I changed this:

case WM_ACTIVATE:
{
//bool active = (LOWORD(wParam) != WA_INACTIVE);
//win->setActive( active );
//My addition :(
win->setActive( true );
//
for( ; start != end; ++start )
(start->second)->windowFocusChange(win);
break;
}


It works; but if anybody knows a better way I'd be more then happy to change it back :oops:

Martin