[Scummvm-git-logs] scummvm master -> 0a7ba01e8e15923d863e992c1fbbafacaeea4dfa

hax0kartik noreply at scummvm.org
Mon Nov 13 12:38:49 UTC 2023


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:
0a7ba01e8e CRAB: Add Debug Output for Keymaps


Commit: 0a7ba01e8e15923d863e992c1fbbafacaeea4dfa
    https://github.com/scummvm/scummvm/commit/0a7ba01e8e15923d863e992c1fbbafacaeea4dfa
Author: Aditya (adityamurali003 at gmail.com)
Date: 2023-11-13T18:08:46+05:30

Commit Message:
CRAB: Add Debug Output for Keymaps

Now keymap being used can known by typing "what keymap" in the debugger
console.

Changed paths:
    engines/crab/console.cpp
    engines/crab/console.h


diff --git a/engines/crab/console.cpp b/engines/crab/console.cpp
index 0ad87ed81e1..c1abb26dee5 100644
--- a/engines/crab/console.cpp
+++ b/engines/crab/console.cpp
@@ -21,11 +21,15 @@
 
 #include "crab/crab.h"
 #include "crab/console.h"
+#include "crab/input/input.h"
 
 namespace Crab {
 
+using namespace pyrodactyl::input;
+
 Console::Console() : GUI::Debugger() {
 	registerCmd("draw", WRAP_METHOD(Console, cmdDraw));
+	registerCmd("what", WRAP_METHOD(Console, cmdWhat));
 }
 
 Console::~Console() {
@@ -53,4 +57,32 @@ bool Console::cmdDraw(int argc, const char **argv) {
 	return true;
 }
 
+bool Console::cmdWhat(int argc, const char **argv) {
+	if (argc > 1) {
+		for (int i = 1; i < argc; i++) {
+			if (!scumm_stricmp(argv[i], "keymap")) {
+				switch (g_engine->_inputManager->getKeyBindingMode()) {
+				case KBM_NONE:
+					debugPrintf("KBM_NONE\n");
+					break;
+
+				case KBM_GAME:
+					debugPrintf("KBM_GAME\n");
+					break;
+
+				case KBM_UI:
+					debugPrintf("KBM_UI\n");
+					break;
+
+				default:
+					debugPrintf("Unknown KBM\n");
+					break;
+				}
+			} else
+				debugPrintf("Valid parameters are 'keymap'\n");
+		}
+	}
+	return true;
+}
+
 } // End of namespace Crab
diff --git a/engines/crab/console.h b/engines/crab/console.h
index 11992f6e625..c54a19e5a9a 100644
--- a/engines/crab/console.h
+++ b/engines/crab/console.h
@@ -29,6 +29,7 @@ namespace Crab {
 class Console : public GUI::Debugger {
 private:
 	bool cmdDraw(int argc, const char **argv);
+	bool cmdWhat(int argc, const char **argv);
 
 public:
 	Console();




More information about the Scummvm-git-logs mailing list