summaryrefslogtreecommitdiff
path: root/src/gui/widgets/inttextfield.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/inttextfield.cpp')
-rw-r--r--src/gui/widgets/inttextfield.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gui/widgets/inttextfield.cpp b/src/gui/widgets/inttextfield.cpp
index 8a075000b..fbc51ee3d 100644
--- a/src/gui/widgets/inttextfield.cpp
+++ b/src/gui/widgets/inttextfield.cpp
@@ -22,6 +22,9 @@
#include "gui/widgets/inttextfield.h"
+#include "keydata.h"
+#include "keyevent.h"
+
#include "gui/sdlinput.h"
#include "utils/stringutils.h"
@@ -44,10 +47,9 @@ IntTextField::IntTextField(int def, int min, int max,
void IntTextField::keyPressed(gcn::KeyEvent &event)
{
- const gcn::Key &key = event.getKey();
+ int action = static_cast<KeyEvent*>(&event)->getActionId();
- if (key.getValue() == Key::BACKSPACE ||
- key.getValue() == Key::DELETE)
+ if (action == Input::KEY_GUI_DELETE || action == Input::KEY_GUI_BACKSPACE)
{
setText(std::string());
if (mSendAlwaysEvents)
@@ -56,7 +58,7 @@ void IntTextField::keyPressed(gcn::KeyEvent &event)
event.consume();
}
- if (!key.isNumber())
+ if (!event.getKey().isNumber())
return;
TextField::keyPressed(event);