summaryrefslogtreecommitdiff
path: root/src/gui/widgets/textfield.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/textfield.cpp')
-rw-r--r--src/gui/widgets/textfield.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/gui/widgets/textfield.cpp b/src/gui/widgets/textfield.cpp
index d7d73f78a..d1f19785f 100644
--- a/src/gui/widgets/textfield.cpp
+++ b/src/gui/widgets/textfield.cpp
@@ -245,16 +245,16 @@ int TextField::getValue() const
return value;
}
-void TextField::keyPressed(KeyEvent &keyEvent)
+void TextField::keyPressed(KeyEvent &event)
{
- const int val = keyEvent.getKey().getValue();
+ const int val = event.getKey().getValue();
#ifdef USE_SDL2
if (val == Key::TEXTINPUT)
{
- std::string str = keyEvent.getText();
+ std::string str = event.getText();
mText.insert(mCaretPosition, str);
mCaretPosition += str.size();
- keyEvent.consume();
+ event.consume();
fixScroll();
if (mSendAlwaysEvents)
distributeActionEvent();
@@ -273,7 +273,7 @@ void TextField::keyPressed(KeyEvent &keyEvent)
buf[1] = 0;
mText.insert(mCaretPosition, std::string(buf));
mCaretPosition += 1;
- keyEvent.consume();
+ event.consume();
fixScroll();
if (mSendAlwaysEvents)
distributeActionEvent();
@@ -305,7 +305,7 @@ void TextField::keyPressed(KeyEvent &keyEvent)
mText.insert(mCaretPosition, std::string(buf, buf + len));
mCaretPosition += len;
- keyEvent.consume();
+ event.consume();
fixScroll();
if (mSendAlwaysEvents)
distributeActionEvent();
@@ -323,14 +323,14 @@ void TextField::keyPressed(KeyEvent &keyEvent)
bool consumed(false);
#endif
- const int action = keyEvent.getActionId();
+ const int action = event.getActionId();
if (!inputManager.isActionActive(static_cast<int>(
Input::KEY_GUI_CTRL)))
{
if (!handleNormalKeys(action, consumed))
{
if (consumed)
- keyEvent.consume();
+ event.consume();
return;
}
}
@@ -343,7 +343,7 @@ void TextField::keyPressed(KeyEvent &keyEvent)
distributeActionEvent();
if (consumed)
- keyEvent.consume();
+ event.consume();
fixScroll();
}