|
|
|
@ -40,6 +40,7 @@ namespace MWInput
|
|
|
|
|
, mMouseLookEnabled(true)
|
|
|
|
|
, mMouseX(ogre.getWindow()->getWidth ()/2.f)
|
|
|
|
|
, mMouseY(ogre.getWindow()->getHeight ()/2.f)
|
|
|
|
|
, mMouseWheel(0)
|
|
|
|
|
, mUserFile(userFile)
|
|
|
|
|
, mDragDrop(false)
|
|
|
|
|
, mGuiCursorEnabled(false)
|
|
|
|
@ -242,6 +243,11 @@ namespace MWInput
|
|
|
|
|
mKeyboard->capture();
|
|
|
|
|
mMouse->capture();
|
|
|
|
|
|
|
|
|
|
// inject some fake mouse movement to force updating MyGUI's widget states
|
|
|
|
|
// this shouldn't do any harm since we're moving back to the original position afterwards
|
|
|
|
|
MyGUI::InputManager::getInstance().injectMouseMove( int(mMouseX+1), int(mMouseY+1), mMouseWheel);
|
|
|
|
|
MyGUI::InputManager::getInstance().injectMouseMove( int(mMouseX), int(mMouseY), mMouseWheel);
|
|
|
|
|
|
|
|
|
|
// update values of channels (as a result of pressed keys)
|
|
|
|
|
if (!loading)
|
|
|
|
|
mInputCtrl->update(dt);
|
|
|
|
@ -486,8 +492,9 @@ namespace MWInput
|
|
|
|
|
mMouseY += float(arg.state.Y.rel) * mUISensitivity * mUIYMultiplier;
|
|
|
|
|
mMouseX = std::max(0.f, std::min(mMouseX, float(viewSize.width)));
|
|
|
|
|
mMouseY = std::max(0.f, std::min(mMouseY, float(viewSize.height)));
|
|
|
|
|
mMouseWheel = arg.state.Z.abs;
|
|
|
|
|
|
|
|
|
|
MyGUI::InputManager::getInstance().injectMouseMove( int(mMouseX), int(mMouseY), arg.state.Z.abs);
|
|
|
|
|
MyGUI::InputManager::getInstance().injectMouseMove( int(mMouseX), int(mMouseY), mMouseWheel);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (mMouseLookEnabled)
|
|
|
|
|