As the title states, I have a program running fine under Windows and Linux (Ubunti 9.10) but OIS does not provide any input events under OSX. Using Ogre 1.6.5 and the following code, directly ripped from Ogre samples with the exception of using buffered input modes.
Ogre::LogManager::getSingletonPtr()->logMessage("*** Initializing OIS ***");
OIS::ParamList pl;
size_t windowHnd = 0;
std::ostringstream windowHndStr;
win->getCustomAttribute("WINDOW", &windowHnd);
windowHndStr << windowHnd;
pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str()));
#ifdef WINDOWS
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")));
#else
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
mKeyboard = static_cast<OIS::Keyboard*>(mInputManager->createInputObject(OIS::OISKeyboard, true ));
mMouse = static_cast<OIS::Mouse*>(mInputManager->createInputObject( OIS::OISMouse, true ));
windowResized(win);
m_pGUIListener = new CGUIListener(win, pInputHandler);
mMouse->setEventCallback(m_pGUIListener);
mKeyboard->setEventCallback(m_pGUIListener);
Ogre::WindowEventUtilities::addWindowEventListener(win, this);
Looking at the Mac OIS code, it seems the parameter block ignores both the Windows and Linux/X11 parameters and has no analogs, so I just left the Linux stuff in for now (yes I tried it without).
The mouse and the keyboard object look to be sane and do point to my listener object, it just never calls any of the event functions.
The OIS console sample works, as does the Ogre samples so I am assuming there is something I am doing wrong but I just can't seem to find it. Seeing that it works in the other platforms, it must be something Mac specific...