use the virtual keyboard facilities if available, when needed
svn-id: r29882
This commit is contained in:
parent
4a3dedfe7e
commit
e861cf567d
2 changed files with 16 additions and 2 deletions
|
@ -956,6 +956,7 @@ void Game::handleBootParam(int value) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Game::getYN() {
|
bool Game::getYN() {
|
||||||
|
OSystem &system = *g_system;
|
||||||
Mouse &mouse = Mouse::getReference();
|
Mouse &mouse = Mouse::getReference();
|
||||||
Events &events = Events::getReference();
|
Events &events = Events::getReference();
|
||||||
Screen &screen = Screen::getReference();
|
Screen &screen = Screen::getReference();
|
||||||
|
@ -967,7 +968,12 @@ bool Game::getYN() {
|
||||||
else if ((l == DE_DEU) || (l == NL_NLD)) y = Common::KEYCODE_j;
|
else if ((l == DE_DEU) || (l == NL_NLD)) y = Common::KEYCODE_j;
|
||||||
else if ((l == ES_ESP) || (l == IT_ITA)) y = Common::KEYCODE_s;
|
else if ((l == ES_ESP) || (l == IT_ITA)) y = Common::KEYCODE_s;
|
||||||
|
|
||||||
|
bool vKbdFlag = g_system->hasFeature(OSystem::kFeatureVirtualKeyboard);
|
||||||
|
if (!vKbdFlag)
|
||||||
mouse.cursorOff();
|
mouse.cursorOff();
|
||||||
|
else
|
||||||
|
g_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, true);
|
||||||
|
|
||||||
Surface *s = Surface::newDialog(190, res.stringList().getString(S_CONFIRM_YN));
|
Surface *s = Surface::newDialog(190, res.stringList().getString(S_CONFIRM_YN));
|
||||||
s->centerOnScreen();
|
s->centerOnScreen();
|
||||||
delete s;
|
delete s;
|
||||||
|
@ -999,7 +1005,10 @@ bool Game::getYN() {
|
||||||
} while (!events.quitFlag && !breakFlag);
|
} while (!events.quitFlag && !breakFlag);
|
||||||
|
|
||||||
screen.update();
|
screen.update();
|
||||||
|
if (!vKbdFlag)
|
||||||
mouse.cursorOn();
|
mouse.cursorOn();
|
||||||
|
else
|
||||||
|
g_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, false);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -424,6 +424,9 @@ bool Surface::getString(Common::String &line, int maxSize, bool isNumeric, bool
|
||||||
bool vKbdFlag = g_system->hasFeature(OSystem::kFeatureVirtualKeyboard);
|
bool vKbdFlag = g_system->hasFeature(OSystem::kFeatureVirtualKeyboard);
|
||||||
if (!vKbdFlag)
|
if (!vKbdFlag)
|
||||||
mouse.cursorOff();
|
mouse.cursorOff();
|
||||||
|
else
|
||||||
|
g_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, true);
|
||||||
|
|
||||||
|
|
||||||
// Insert a cursor character at the end of the string
|
// Insert a cursor character at the end of the string
|
||||||
newLine.insertChar('_', newLine.size());
|
newLine.insertChar('_', newLine.size());
|
||||||
|
@ -489,6 +492,8 @@ bool Surface::getString(Common::String &line, int maxSize, bool isNumeric, bool
|
||||||
|
|
||||||
if (!vKbdFlag)
|
if (!vKbdFlag)
|
||||||
mouse.cursorOn();
|
mouse.cursorOn();
|
||||||
|
else
|
||||||
|
g_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, false);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue