[Scummvm-git-logs] scummvm master -> bfd05e00dc4ee0e8971fa7a367608573bb802512

eriktorbjorn noreply at scummvm.org
Tue Oct 29 20:11:14 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:
bfd05e00dc SCUMM: MACGUI: Disable the "engine-default" keymapper in the save dialog


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

Commit Message:
SCUMM: MACGUI: Disable the "engine-default" keymapper in the save dialog

The "engine-default" keymapper will by default have the "." key as "skip
line". But the way things currently work, that also makes Ctrl+".",
Alt+".", Shift+".", etc. the "skip line" key. And on my keyboard
Shift+"." is ":", which I may sensibly want to have in my savegame
names.

Of course, this doesn't keep the other keymappers from doing the same
thing. But there are stuff in those that we may still want active, even
while saving.

Changed paths:
    engines/scumm/input.cpp
    engines/scumm/macgui/macgui_impl.cpp
    engines/scumm/scumm.h


diff --git a/engines/scumm/input.cpp b/engines/scumm/input.cpp
index 74585bb34d3..9638266dd55 100644
--- a/engines/scumm/input.cpp
+++ b/engines/scumm/input.cpp
@@ -25,6 +25,8 @@
 #include "common/translation.h"
 #include "audio/mixer.h"
 
+#include "backends/keymapper/keymapper.h"
+
 #include "scumm/debugger.h"
 #include "scumm/dialogs.h"
 #include "scumm/insane/insane.h"
@@ -332,6 +334,20 @@ void ScummEngine::parseEvent(Common::Event event) {
 	}
 }
 
+void ScummEngine::beginTextInput() {
+	Common::Keymapper *keymapper = _system->getEventManager()->getKeymapper();
+	Common::Keymap *engineDefault = keymapper->getKeymap("engine-default");
+
+	engineDefault->setEnabled(false);
+}
+
+void ScummEngine::endTextInput() {
+	Common::Keymapper *keymapper = _system->getEventManager()->getKeymapper();
+	Common::Keymap *engineDefault = keymapper->getKeymap("engine-default");
+
+	engineDefault->setEnabled(true);
+}
+
 void ScummEngine::parseEvents() {
 	Common::Event event;
 
diff --git a/engines/scumm/macgui/macgui_impl.cpp b/engines/scumm/macgui/macgui_impl.cpp
index b808ae4320b..e42134649d6 100644
--- a/engines/scumm/macgui/macgui_impl.cpp
+++ b/engines/scumm/macgui/macgui_impl.cpp
@@ -325,12 +325,13 @@ bool MacGuiImpl::handleMenu(int id, Common::String &name) {
 		return true;
 
 	case 201:	// Save
+		_vm->beginTextInput();
 		if (runSaveDialog(saveSlotToHandle, savegameName)) {
 			if (saveSlotToHandle > -1) {
 				_vm->saveGameState(saveSlotToHandle, savegameName);
 			}
 		}
-
+		_vm->endTextInput();
 		return true;
 
 	case 202:	// Restart
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h
index f349494aa9d..802cb25260f 100644
--- a/engines/scumm/scumm.h
+++ b/engines/scumm/scumm.h
@@ -631,6 +631,9 @@ protected:
 
 	// Event handling
 public:
+	void beginTextInput();
+	void endTextInput();
+
 	void parseEvents();	// Used by IMuseDigital::startSound
 protected:
 	virtual void parseEvent(Common::Event event);




More information about the Scummvm-git-logs mailing list