Mouse position capture is not working 100% under Linux - and look at all this rubbish you have to deal with under Win32:
Important Notes
- Very Important: If not using Ogre's startRendering() call (ie, using renderOneFrame() or window->update() instead), make sure you pump Win32 messages - this can be done with Ogre's Ogre::WindowEventUtilities::messagePump();. If you forget, you will have wierd behavior with regards to text/shift/capslock.
- The first call to InputManager::getSingletonPtr() creates (with new) the input manager. Do not forget to destroy it (OIS::InputManager::destroyInputSystem()).
- Don't forget to capture before every frame!
- If your renderwindow resizes, you should readjust the Mouse clipping values of mousestate structure.
- In buffered mode keyboard keys will trigger a call to keyPressed() and keyReleased(). Unbuffered access (or immediate access) to the keyboard keys is obtained via a call to InputManager::getSingletonPtr()->getKeyboard()->isKeyDown(OIS::KC_UP), in this case to test whether the up arrow is pressed. If you are calling capture() outside of FrameStarted(), such as within a main loop, the following hack will trigger a call to keyPressed() with an "unassigned" key. Add two lines to the keyboard handling code within InputManager::capture( void ):
0 comments:
Post a Comment