[Scummvm-git-logs] scummvm master -> 53c41d591dff10294e297659b9d59145d2ceb9b4

eriktorbjorn noreply at scummvm.org
Mon Nov 4 20:02:13 UTC 2024


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
53c41d591d SCUMM: Disable some keysmaps while writing some savegame names


Commit: 53c41d591dff10294e297659b9d59145d2ceb9b4
    https://github.com/scummvm/scummvm/commit/53c41d591dff10294e297659b9d59145d2ceb9b4
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-11-04T21:00:56+01:00

Commit Message:
SCUMM: Disable some keysmaps while writing some savegame names

The userWriteLabelRoutine() seems to be used by several, but far from
all, of the SCUMM games when using the original GUI. Disable the
engine-default keymap while it's running, so that it won't clash with
text input.

Changed paths:
    engines/scumm/gfx_gui.cpp
    engines/scumm/input.cpp


diff --git a/engines/scumm/gfx_gui.cpp b/engines/scumm/gfx_gui.cpp
index 1e1a5e0f8e3..154d76ebd0d 100644
--- a/engines/scumm/gfx_gui.cpp
+++ b/engines/scumm/gfx_gui.cpp
@@ -2285,7 +2285,7 @@ bool ScummEngine::userWriteLabelRoutine(Common::KeyState &ks, bool &leftMsClicke
 	bool hasLoadedState = false;
 	int firstChar = (_game.version == 4 && _game.id != GID_LOOM) ? 0 : 4;
 	bool opResult = true;
-	_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, true);
+	beginTextInput();
 
 	while (!shouldQuit()) {
 		waitForTimer(1);
@@ -2296,7 +2296,7 @@ bool ScummEngine::userWriteLabelRoutine(Common::KeyState &ks, bool &leftMsClicke
 			clearClickedStatus();
 			opResult = executeMainMenuOperation(GUI_CTRL_OK_BUTTON, -1, -1, hasLoadedState);
 
-			_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, false);
+			endTextInput();
 			return opResult;
 		} else if (leftMsClicked) {
 			clearClickedStatus();
@@ -2327,7 +2327,7 @@ bool ScummEngine::userWriteLabelRoutine(Common::KeyState &ks, bool &leftMsClicke
 		clearClickedStatus();
 	}
 
-	_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, false);
+	endTextInput();
 	return false;
 }
 
diff --git a/engines/scumm/input.cpp b/engines/scumm/input.cpp
index 9638266dd55..51eadfecefe 100644
--- a/engines/scumm/input.cpp
+++ b/engines/scumm/input.cpp
@@ -339,6 +339,7 @@ void ScummEngine::beginTextInput() {
 	Common::Keymap *engineDefault = keymapper->getKeymap("engine-default");
 
 	engineDefault->setEnabled(false);
+	_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, true);
 }
 
 void ScummEngine::endTextInput() {
@@ -346,6 +347,7 @@ void ScummEngine::endTextInput() {
 	Common::Keymap *engineDefault = keymapper->getKeymap("engine-default");
 
 	engineDefault->setEnabled(true);
+	_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, false);
 }
 
 void ScummEngine::parseEvents() {




More information about the Scummvm-git-logs mailing list