[Scummvm-git-logs] scummvm master -> 8a87db94debf7cb2d2962323c0d2770c4c464560

antoniou79 a.antoniou79 at gmail.com
Sat Sep 26 14:01:44 UTC 2020


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:
8a87db94de KEYMAPPER: remap timeout (ms) can be set from config


Commit: 8a87db94debf7cb2d2962323c0d2770c4c464560
    https://github.com/scummvm/scummvm/commit/8a87db94debf7cb2d2962323c0d2770c4c464560
Author: antoniou (a.antoniou79 at gmail.com)
Date: 2020-09-26T17:00:57+03:00

Commit Message:
KEYMAPPER: remap timeout (ms) can be set from config

Config key is "remap_timeout_delay_ms", min value is 3000

Changed paths:
    backends/keymapper/remap-widget.cpp
    backends/keymapper/remap-widget.h
    backends/platform/android/android.cpp


diff --git a/backends/keymapper/remap-widget.cpp b/backends/keymapper/remap-widget.cpp
index 594ac907dd..a73b1fcfb6 100644
--- a/backends/keymapper/remap-widget.cpp
+++ b/backends/keymapper/remap-widget.cpp
@@ -216,7 +216,12 @@ void RemapWidget::startRemapping(uint actionIndex) {
 
 	_remapKeymap = _actions[actionIndex].keymap;
 	_remapAction = _actions[actionIndex].action;
-	_remapTimeout = g_system->getMillis() + kRemapTimeoutDelay;
+
+	uint32 remapTimeoutDelay = kRemapMinTimeoutDelay;
+	if (ConfMan.hasKey("remap_timeout_delay_ms") && (ConfMan.getInt("remap_timeout_delay_ms") > kRemapMinTimeoutDelay)) {
+		remapTimeoutDelay = (uint32)ConfMan.getInt("remap_timeout_delay_ms");
+	}
+	_remapTimeout = g_system->getMillis() + remapTimeoutDelay;
 	_remapInputWatcher->startWatching();
 
 	_actions[actionIndex].keyButton->setLabel("...");
diff --git a/backends/keymapper/remap-widget.h b/backends/keymapper/remap-widget.h
index 3076b45633..a0f9cdab6f 100644
--- a/backends/keymapper/remap-widget.h
+++ b/backends/keymapper/remap-widget.h
@@ -90,7 +90,7 @@ protected:
 	Action *_remapAction;
 	uint32 _remapTimeout;
 
-	static const uint32 kRemapTimeoutDelay = 3000;
+	static const uint32 kRemapMinTimeoutDelay = 3000;
 
 	bool _changes;
 
diff --git a/backends/platform/android/android.cpp b/backends/platform/android/android.cpp
index 7bb91fc6d1..8ffa7cd63f 100644
--- a/backends/platform/android/android.cpp
+++ b/backends/platform/android/android.cpp
@@ -320,6 +320,13 @@ void OSystem_Android::initBackend() {
 	ConfMan.setBool("FM_high_quality", false);
 	ConfMan.setBool("FM_medium_quality", true);
 
+	// we need a relaxed delay for the remapping timeout since handling touch interface and virtual keyboard can be slow
+	// and especially in some occasions when we need to pull down (hide) the keyboard and map a system key (like the AC_Back) button.
+	// 8 seconds should be enough
+	ConfMan.registerDefault("remap_timeout_delay_ms", 8000);
+	if (!ConfMan.hasKey("remap_timeout_delay_ms")) {
+		ConfMan.setInt("remap_timeout_delay_ms", 8000);
+	}
 
 	if (!ConfMan.hasKey("browser_lastpath")) {
 		// TODO remove the debug message eventually




More information about the Scummvm-git-logs mailing list