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

bluegr noreply at scummvm.org
Sun Jul 20 10:18:27 UTC 2025


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

Summary:
b41afcfcac SCI: Toggle virtual keyboard for editable text fields in SCI32 games
fcf0709f64 SCI: Toggle virtual keyboard for editable text fields in SCI16 games


Commit: b41afcfcac00038d1686662d04dceb83d34f56e6
    https://github.com/scummvm/scummvm/commit/b41afcfcac00038d1686662d04dceb83d34f56e6
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2025-07-20T13:17:33+03:00

Commit Message:
SCI: Toggle virtual keyboard for editable text fields in SCI32 games

Changed paths:
    engines/sci/graphics/controls32.cpp


diff --git a/engines/sci/graphics/controls32.cpp b/engines/sci/graphics/controls32.cpp
index c2bd7f8f8f8..876d2f2debf 100644
--- a/engines/sci/graphics/controls32.cpp
+++ b/engines/sci/graphics/controls32.cpp
@@ -134,6 +134,8 @@ reg_t GfxControls32::kernelEditText(const reg_t controlObject) {
 	ScreenItem *screenItem = new ScreenItem(plane->_object, celInfo, Common::Point(), ScaleInfo());
 	plane->_screenItemList.add(screenItem);
 
+	g_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, true);
+
 	// frameOut must be called after the screen item is created, and before it
 	// is updated at the end of the event loop, otherwise it has both created
 	// and updated flags set which crashes the engine (updates are handled
@@ -188,6 +190,8 @@ reg_t GfxControls32::kernelEditText(const reg_t controlObject) {
 		}
 	}
 
+	g_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, false);
+
 	g_sci->_gfxFrameout->deletePlane(*plane);
 	if (readSelectorValue(_segMan, controlObject, SELECTOR(frameOut))) {
 		g_sci->_gfxFrameout->frameOut(true);
@@ -253,6 +257,8 @@ reg_t GfxControls32::kernelInputText(const reg_t textObject, const reg_t titleOb
 	ScreenItem *screenItem = new ScreenItem(plane->_object, celInfo, Common::Point(), ScaleInfo());
 	plane->_screenItemList.add(screenItem);
 
+	g_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, true);
+
 	g_sci->_gfxFrameout->frameOut(true);
 
 	EventManager *eventManager = g_sci->getEventManager();
@@ -291,6 +297,8 @@ reg_t GfxControls32::kernelInputText(const reg_t textObject, const reg_t titleOb
 		processEditTextEvent(event, editor, screenItem, clearTextOnInput);
 	}
 
+	g_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, false);
+
 	g_sci->_gfxFrameout->deletePlane(*plane);
 	g_sci->_gfxFrameout->frameOut(true);
 	_segMan->freeBitmap(editor.bitmap);


Commit: fcf0709f6462c8520b4d9d3761febcd196fad784
    https://github.com/scummvm/scummvm/commit/fcf0709f6462c8520b4d9d3761febcd196fad784
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2025-07-20T13:17:35+03:00

Commit Message:
SCI: Toggle virtual keyboard for editable text fields in SCI16 games

Changed paths:
    engines/sci/graphics/controls16.cpp
    engines/sci/graphics/ports.cpp
    engines/sci/graphics/ports.h


diff --git a/engines/sci/graphics/controls16.cpp b/engines/sci/graphics/controls16.cpp
index ac9c96f2771..aac0b3d3352 100644
--- a/engines/sci/graphics/controls16.cpp
+++ b/engines/sci/graphics/controls16.cpp
@@ -443,9 +443,15 @@ void GfxControls16::kernelDrawTextEdit(Common::Rect rect, reg_t obj, const char
 		texteditCursorDraw(rect, text, cursorPos);
 		_text16->SetFont(oldFontId);
 		rect.grow(1);
+
+		g_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, true);
+	} else {
+		g_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, false);
 	}
 	if (!getPicNotValid())
 		_paint16->bitsShow(rect);
+
+	_ports->setActiveWindowHasEditText();
 }
 
 void GfxControls16::kernelDrawIcon(Common::Rect rect, reg_t obj, GuiResourceId viewId, int16 loopNo, int16 celNo, int16 priority, int16 style, bool hilite) {
diff --git a/engines/sci/graphics/ports.cpp b/engines/sci/graphics/ports.cpp
index 67addc0487f..1bfe51afcdd 100644
--- a/engines/sci/graphics/ports.cpp
+++ b/engines/sci/graphics/ports.cpp
@@ -19,6 +19,7 @@
  *
  */
 
+#include "common/system.h"
 #include "common/util.h"
 
 #include "sci/console.h"
@@ -249,6 +250,11 @@ void GfxPorts::kernelDisposeWindow(uint16 windowId, bool reanimate) {
 	} else {
 		error("kDisposeWindow: used unknown window id %d", windowId);
 	}
+
+	if (windowId == _portIdWithEditText) {
+		g_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, false);
+		_portIdWithEditText = -1;
+	}
 }
 
 int16 GfxPorts::isFrontWindow(Window *pWnd) {
diff --git a/engines/sci/graphics/ports.h b/engines/sci/graphics/ports.h
index 58aa300b22c..7bbe87804a6 100644
--- a/engines/sci/graphics/ports.h
+++ b/engines/sci/graphics/ports.h
@@ -64,6 +64,8 @@ public:
 	reg_t kernelNewWindow(Common::Rect dims, Common::Rect restoreRect, uint16 style, int16 priority, int16 colorPen, int16 colorBack, const char *title);
 	void kernelDisposeWindow(uint16 windowId, bool reanimate);
 
+	void setActiveWindowHasEditText() { _portIdWithEditText = (int16)getPort()->id; }
+
 	int16 isFrontWindow(Window *wnd);
 	void beginUpdate(Window *wnd);
 	void endUpdate(Window *wnd);
@@ -137,6 +139,7 @@ private:
 	// Priority Bands related variables
 	int16 _priorityTop, _priorityBottom, _priorityBandCount;
 	byte _priorityBands[200];
+	int16 _portIdWithEditText = -1; // ID of the port that has an edit text field
 };
 
 } // End of namespace Sci




More information about the Scummvm-git-logs mailing list