|
|
|
@ -51,6 +51,7 @@ namespace MWInput
|
|
|
|
|
, mUIYMultiplier (Settings::Manager::getFloat("ui y multiplier", "Input"))
|
|
|
|
|
, mPreviewPOVDelay(0.f)
|
|
|
|
|
, mTimeIdle(0.f)
|
|
|
|
|
, mEnterPressed(false)
|
|
|
|
|
{
|
|
|
|
|
Ogre::RenderWindow* window = ogre.getWindow ();
|
|
|
|
|
size_t windowHnd;
|
|
|
|
@ -239,6 +240,10 @@ namespace MWInput
|
|
|
|
|
|
|
|
|
|
void InputManager::update(float dt, bool loading)
|
|
|
|
|
{
|
|
|
|
|
// Pressing enter when a messagebox is prompting for "ok" will activate the ok button
|
|
|
|
|
if(mEnterPressed && MWBase::Environment::get().getWindowManager()->isGuiMode() && MWBase::Environment::get().getWindowManager()->getMode() == MWGui::GM_InterMessageBox)
|
|
|
|
|
MWBase::Environment::get().getWindowManager()->enterPressed();
|
|
|
|
|
|
|
|
|
|
// Tell OIS to handle all input events
|
|
|
|
|
mKeyboard->capture();
|
|
|
|
|
mMouse->capture();
|
|
|
|
@ -251,7 +256,7 @@ namespace MWInput
|
|
|
|
|
// update values of channels (as a result of pressed keys)
|
|
|
|
|
if (!loading)
|
|
|
|
|
mInputCtrl->update(dt);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Update windows/gui as a result of input events
|
|
|
|
|
// For instance this could mean opening a new window/dialog,
|
|
|
|
|
// by doing this after the input events are handled we
|
|
|
|
@ -426,6 +431,9 @@ namespace MWInput
|
|
|
|
|
|
|
|
|
|
bool InputManager::keyPressed( const OIS::KeyEvent &arg )
|
|
|
|
|
{
|
|
|
|
|
if(arg.key == OIS::KC_RETURN && MWBase::Environment::get().getWindowManager()->isGuiMode() && MWBase::Environment::get().getWindowManager()->getMode() != MWGui::GM_Console)
|
|
|
|
|
mEnterPressed = true;
|
|
|
|
|
|
|
|
|
|
mInputCtrl->keyPressed (arg);
|
|
|
|
|
unsigned int text = arg.text;
|
|
|
|
|
#ifdef __APPLE__ // filter \016 symbol for F-keys on OS X
|
|
|
|
@ -442,6 +450,9 @@ namespace MWInput
|
|
|
|
|
|
|
|
|
|
bool InputManager::keyReleased( const OIS::KeyEvent &arg )
|
|
|
|
|
{
|
|
|
|
|
if(arg.key == OIS::KC_RETURN)
|
|
|
|
|
mEnterPressed = false;
|
|
|
|
|
|
|
|
|
|
mInputCtrl->keyReleased (arg);
|
|
|
|
|
|
|
|
|
|
MyGUI::InputManager::getInstance().injectKeyRelease(MyGUI::KeyCode::Enum(arg.key));
|
|
|
|
|