Skip to content

Commit

Permalink
GUI: show/hide virtual keyboard when the EditTextWidget gains/loses t…
Browse files Browse the repository at this point in the history
…he focus
  • Loading branch information
criezy committed Feb 16, 2019
1 parent 284a4e2 commit 63a6a3c
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions gui/widgets/edittext.cpp
Expand Up @@ -87,12 +87,6 @@ void EditTextWidget::handleMouseDown(int x, int y, int button, int clickCount) {
}
if (setCaretPos(i))
markAsDirty();

#ifdef TIZEN
// Display the virtual keypad to allow text entry. Samsung app-store testers expected
// the keypad to be displayed when clicking the filter edit control in the laucher gui.
g_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, true);
#endif
}

void EditTextWidget::drawWidget() {
Expand All @@ -118,12 +112,15 @@ Common::Rect EditTextWidget::getEditRect() const {
}

void EditTextWidget::receivedFocusWidget() {
g_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, true);
}

void EditTextWidget::lostFocusWidget() {
// If we loose focus, 'commit' the user changes
_backupString = _editString;
drawCaret(true);

g_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, false);
}

void EditTextWidget::startEditMode() {
Expand Down

0 comments on commit 63a6a3c

Please sign in to comment.