I found a working solution for this. Firstly, I had to create Ogre::RenderWindow in windowed mode, and not in full-screen mode - full-screen mode was emulated quite simply, creating Ogre::RenderWindow without borders:
Ogre::NameValuePairList options; options["left"] = "0"; options["top"] = "0"; options["border"] = "none"; options["monitorIndex"] = "0"; m_pVisWindow[0] = mRoot->createRenderWindow("Window1", 1920, 1200, false, &options); options["monitorIndex"] = "1"; m_pVizWindow[1] = mRoot->createRenderWindow("Window2", 1920, 1200, false, &options); options["monitorIndex"] = "2"; m_pVizWindow[2] = mRoot->createRenderWindow("Window3", 1920, 1200, false, &options); options["monitorIndex"] = "3"; m_pVizWindow[3] = mRoot->createRenderWindow("Window4", 1920, 1200, false, &options); options["monitorIndex"] = "4"; m_pVizWindow[4] = mRoot->createRenderWindow("Window5", 1920, 1200, false, &options); options["monitorIndex"] = "5"; m_pVizWindow[5] = mRoot->createRenderWindow("Window6", 1920, 1200, false, &options);
In the Ogre::FrameListener constructor attached to each Ogre::RenderWindow (which in this case inherits from ExampleFrameListener , I essentially had to destroy the existing mInputManager and create a new instance with parameters to configure OIS for non-exclusive input. A more detailed description of how and why do this can be found here .
mInputManager->destroyInputObject(mMouse); mInputManager->destroyInputObject(mKeyboard); mInputManager->destroyInputObject(mJoy); OIS::InputManager::destroyInputSystem(mInputManager); // override OIS construction to avoid grabbing mouse OIS::ParamList pl; size_t windowHnd = 0; std::ostringstream windowHndStr; window->getCustomAttribute("WINDOW", &windowHnd); windowHndStr << windowHnd; pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str())); #if defined OIS_WIN32_PLATFORM 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"))); pl.insert(std::make_pair(std::string("w32_keyboard"), std::string("DISCL_FOREGROUND"))); pl.insert(std::make_pair(std::string("w32_keyboard"), std::string("DISCL_NONEXCLUSIVE"))); #elif defined OIS_LINUX_PLATFORM pl.insert(std::make_pair(std::string("x11_mouse_grab"), std::string("false"))); pl.insert(std::make_pair(std::string("x11_mouse_hide"), std::string("false"))); pl.insert(std::make_pair(std::string("x11_keyboard_grab"), std::string("false"))); pl.insert(std::make_pair(std::string("XAutoRepeatOn"), std::string("true"))); #endif mInputManager = OIS::InputManager::createInputSystem( pl ); //Create all devices (We only catch joystick exceptions here, as, most people have Key/Mouse) mKeyboard = static_cast<OIS::Keyboard*>(mInputManager->createInputObject( OIS::OISKeyboard, false )); mMouse = static_cast<OIS::Mouse*>(mInputManager->createInputObject( OIS::OISMouse, false )); try { mJoy = static_cast<OIS::JoyStick*>(mInputManager->createInputObject( OIS::OISJoyStick, false )); } catch(...) { mJoy = 0; }
I still need to physically click on a specific render window to give it focus, so it would be nice if there was a way to give focus to the render window in the mouseover event - however, that suits my needs now ...