summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-10-01 21:23:36 +0300
committerAndrei Karas <akaras@inbox.ru>2014-10-01 21:23:36 +0300
commit9aa0f34c4a6205590d7dbba6f0a65f91a4897ed0 (patch)
treebf963d72dadbdd7a969fd1791083145728362806 /src
parentcd8b69ef3edafde047ad4db6f7b81afb53bb23f0 (diff)
downloadmv-9aa0f34c4a6205590d7dbba6f0a65f91a4897ed0.tar.gz
mv-9aa0f34c4a6205590d7dbba6f0a65f91a4897ed0.tar.bz2
mv-9aa0f34c4a6205590d7dbba6f0a65f91a4897ed0.tar.xz
mv-9aa0f34c4a6205590d7dbba6f0a65f91a4897ed0.zip
Fix input fields detection for input rules.
Diffstat (limited to 'src')
-rw-r--r--src/input/inputmanager.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/input/inputmanager.cpp b/src/input/inputmanager.cpp
index 4405b0c0a..83e01d0ba 100644
--- a/src/input/inputmanager.cpp
+++ b/src/input/inputmanager.cpp
@@ -38,6 +38,7 @@
#include "gui/sdlinput.h"
#include "gui/widgets/selldialog.h"
+#include "gui/widgets/textfield.h"
#include "gui/widgets/tabs/setup_input.h"
@@ -657,7 +658,23 @@ void InputManager::updateConditionMask()
!InventoryWindow::isAnyInputFocused() &&
(!tradeWindow || !tradeWindow->isInpupFocused()))
{
- mMask |= InputCondition::NOINPUT;
+ if (gui)
+ {
+ FocusHandler *const focus = gui->getFocusHandler();
+ if (focus)
+ {
+ if (!dynamic_cast<TextField*>(focus->getFocused()))
+ mMask |= InputCondition::NOINPUT;
+ }
+ else
+ {
+ mMask |= InputCondition::NOINPUT;
+ }
+ }
+ else
+ {
+ mMask |= InputCondition::NOINPUT;
+ }
}
if (!BuyDialog::isActive() && !SellDialog::isActive())