summaryrefslogtreecommitdiff
path: root/src/gui/widgets/textfield.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-05-18 19:47:28 +0300
committerAndrei Karas <akaras@inbox.ru>2014-05-18 19:47:28 +0300
commit7da95c7f4da447876458a0b1a17736b9a2865844 (patch)
tree4b6ac0ab5bc32a11234a5363de95d0cfec8cb7d5 /src/gui/widgets/textfield.cpp
parent515ce6c1413b5e3da131f3e4997abdc39c003a2c (diff)
downloadmv-7da95c7f4da447876458a0b1a17736b9a2865844.tar.gz
mv-7da95c7f4da447876458a0b1a17736b9a2865844.tar.bz2
mv-7da95c7f4da447876458a0b1a17736b9a2865844.tar.xz
mv-7da95c7f4da447876458a0b1a17736b9a2865844.zip
Move inputaction into separate file.
Diffstat (limited to 'src/gui/widgets/textfield.cpp')
-rw-r--r--src/gui/widgets/textfield.cpp46
1 files changed, 23 insertions, 23 deletions
diff --git a/src/gui/widgets/textfield.cpp b/src/gui/widgets/textfield.cpp
index 7aec5e4fc..14faad2f0 100644
--- a/src/gui/widgets/textfield.cpp
+++ b/src/gui/widgets/textfield.cpp
@@ -327,7 +327,7 @@ void TextField::keyPressed(KeyEvent &event)
const int action = event.getActionId();
if (!inputManager.isActionActive(static_cast<int>(
- Input::KEY_GUI_CTRL)))
+ InputAction::GUI_CTRL)))
{
if (!handleNormalKeys(action, consumed))
{
@@ -353,7 +353,7 @@ bool TextField::handleNormalKeys(const int action, bool &consumed)
{
switch (action)
{
- case Input::KEY_GUI_LEFT:
+ case InputAction::GUI_LEFT:
{
consumed = true;
while (mCaretPosition > 0)
@@ -365,7 +365,7 @@ bool TextField::handleNormalKeys(const int action, bool &consumed)
break;
}
- case Input::KEY_GUI_RIGHT:
+ case InputAction::GUI_RIGHT:
{
consumed = true;
const unsigned sz = static_cast<unsigned>(mText.size());
@@ -381,7 +381,7 @@ bool TextField::handleNormalKeys(const int action, bool &consumed)
break;
}
- case Input::KEY_GUI_DELETE:
+ case InputAction::GUI_DELETE:
{
consumed = true;
unsigned sz = static_cast<unsigned>(mText.size());
@@ -398,28 +398,28 @@ bool TextField::handleNormalKeys(const int action, bool &consumed)
break;
}
- case Input::KEY_GUI_BACKSPACE:
+ case InputAction::GUI_BACKSPACE:
consumed = true;
deleteCharLeft(mText, &mCaretPosition);
break;
- case Input::KEY_GUI_SELECT2:
+ case InputAction::GUI_SELECT2:
distributeActionEvent();
consumed = true;
fixScroll();
return false;
- case Input::KEY_GUI_HOME:
+ case InputAction::GUI_HOME:
mCaretPosition = 0;
consumed = true;
break;
- case Input::KEY_GUI_END:
+ case InputAction::GUI_END:
mCaretPosition = static_cast<unsigned>(mText.size());
consumed = true;
break;
- case Input::KEY_GUI_TAB:
+ case InputAction::GUI_TAB:
if (mLoseFocusOnTab)
return false;
consumed = true;
@@ -435,19 +435,19 @@ void TextField::handleCtrlKeys(const int action, bool &consumed)
{
switch (action)
{
- case Input::KEY_GUI_LEFT:
+ case InputAction::GUI_LEFT:
{
moveCaretWordBack();
consumed = true;
break;
}
- case Input::KEY_GUI_RIGHT:
+ case InputAction::GUI_RIGHT:
{
moveCaretWordForward();
consumed = true;
break;
}
- case Input::KEY_GUI_B:
+ case InputAction::GUI_B:
{
if (mAllowSpecialActions)
{
@@ -456,49 +456,49 @@ void TextField::handleCtrlKeys(const int action, bool &consumed)
}
break;
}
- case Input::KEY_GUI_F:
+ case InputAction::GUI_F:
{
moveCaretForward();
consumed = true;
break;
}
- case Input::KEY_GUI_D:
+ case InputAction::GUI_D:
{
caretDelete();
consumed = true;
break;
}
- case Input::KEY_GUI_E:
+ case InputAction::GUI_E:
{
mCaretPosition = static_cast<int>(mText.size());
consumed = true;
break;
}
- case Input::KEY_GUI_H:
+ case InputAction::GUI_H:
{
deleteCharLeft(mText, &mCaretPosition);
consumed = true;
break;
}
- case Input::KEY_GUI_K:
+ case InputAction::GUI_K:
{
mText = mText.substr(0, mCaretPosition);
consumed = true;
break;
}
- case Input::KEY_GUI_U:
+ case InputAction::GUI_U:
{
caretDeleteToStart();
consumed = true;
break;
}
- case Input::KEY_GUI_C:
+ case InputAction::GUI_C:
{
handleCopy();
consumed = true;
break;
}
- case Input::KEY_GUI_V:
+ case InputAction::GUI_V:
{
#ifdef USE_SDL2
handlePaste();
@@ -512,7 +512,7 @@ void TextField::handleCtrlKeys(const int action, bool &consumed)
consumed = true;
break;
}
- case Input::KEY_GUI_W:
+ case InputAction::GUI_W:
{
caretDeleteWord();
consumed = true;
@@ -699,7 +699,7 @@ void TextField::mousePressed(MouseEvent &event)
{
#ifdef ANDROID
if (!client->isKeyboardVisible())
- inputManager.executeAction(Input::KEY_SHOW_KEYBOARD);
+ inputManager.executeAction(InputAction::SHOW_KEYBOARD);
#endif
event.consume();
if (event.getButton() == MouseButton::RIGHT)
@@ -736,7 +736,7 @@ void TextField::focusGained(const Event &event A_UNUSED)
{
#ifdef ANDROID
if (!client->isKeyboardVisible())
- inputManager.executeAction(Input::KEY_SHOW_KEYBOARD);
+ inputManager.executeAction(InputAction::SHOW_KEYBOARD);
#endif
}