[Scummvm-git-logs] scummvm master -> 4aa9251537eeb03b499f64ef325647e100c7cd80

sev- noreply at scummvm.org
Mon Sep 1 15:02:06 UTC 2025


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

Summary:
4aa9251537 DM: Add keymapper support


Commit: 4aa9251537eeb03b499f64ef325647e100c7cd80
    https://github.com/scummvm/scummvm/commit/4aa9251537eeb03b499f64ef325647e100c7cd80
Author: aunnoman1 (aunnoman123 at outlook.com)
Date: 2025-09-01T17:02:03+02:00

Commit Message:
DM: Add keymapper support

Changed paths:
    engines/dm/POTFILES
    engines/dm/champion.cpp
    engines/dm/dialog.cpp
    engines/dm/dm.h
    engines/dm/eventman.cpp
    engines/dm/eventman.h
    engines/dm/metaengine.cpp


diff --git a/engines/dm/POTFILES b/engines/dm/POTFILES
index a04a9a45dfc..708216e6e00 100644
--- a/engines/dm/POTFILES
+++ b/engines/dm/POTFILES
@@ -1,2 +1,3 @@
 engines/dm/dm.cpp
 engines/dm/loadsave.cpp
+engines/dm/metaengine.cpp
diff --git a/engines/dm/champion.cpp b/engines/dm/champion.cpp
index e81dc5750dc..1d2c8b518e7 100644
--- a/engines/dm/champion.cpp
+++ b/engines/dm/champion.cpp
@@ -37,6 +37,8 @@
 #include "dm/movesens.h"
 #include "dm/sounds.h"
 
+#include "backends/keymapper/keymapper.h"
+
 
 namespace DM {
 
@@ -2478,6 +2480,9 @@ void ChampionMan::renameChampion(Champion *champ) {
 	int16 textPosX = 177;
 	int16 textPosY = 91;
 
+	Common::Keymapper *keymapper = _vm->getEventManager()->getKeymapper();
+	keymapper->getKeymap("game-shortcuts")->setEnabled(false);
+
 	for (;;) { /*_Infinite loop_*/
 		bool championTitleIsFull = ((renamedChampionStringMode == kDMRenameChampionTitle) && (curCharacterIndex == 19));
 		if (!championTitleIsFull) {
@@ -2491,8 +2496,10 @@ void ChampionMan::renameChampion(Champion *champ) {
 			Common::Event event;
 			Common::EventType eventType = evtMan.processInput(&event, &event);
 			display.updateScreen();
-			if (_vm->_engineShouldQuit)
+			if (_vm->_engineShouldQuit){
+				keymapper->getKeymap("game-shortcuts")->setEnabled(true);
 				return;
+			}
 			display.updateScreen();
 				//_vm->f22_delay(1);
 
@@ -2518,8 +2525,10 @@ void ChampionMan::renameChampion(Champion *champ) {
 							break;
 						}
 					}
-					if (!found)
+					if (!found) {
+						keymapper->getKeymap("game-shortcuts")->setEnabled(true);
 						return;
+					}
 
 					if (renamedChampionStringMode == kDMRenameChampionTitle)
 						renamedChampionString = champ->_title;
diff --git a/engines/dm/dialog.cpp b/engines/dm/dialog.cpp
index a19294d6499..d6478fe681f 100644
--- a/engines/dm/dialog.cpp
+++ b/engines/dm/dialog.cpp
@@ -29,6 +29,8 @@
 #include "dm/text.h"
 #include "dm/eventman.h"
 
+#include "backends/keymapper/keymapper.h"
+
 namespace DM {
 
 DialogMan::DialogMan(DMEngine *vm) : _vm(vm) {
@@ -175,6 +177,11 @@ int16 DialogMan::getChoice(uint16 choiceCount, uint16 dialogSetIndex, int16 driv
 	evtMan._primaryMouseInput = evtMan._primaryMouseInputDialogSets[dialogSetIndex][choiceCount - 1];
 	evtMan.discardAllInput();
 	_selectedDialogChoice = 99;
+
+	Common::Keymapper *keymapper = _vm->getEventManager()->getKeymapper();
+	keymapper->getKeymap("game-shortcuts")->setEnabled(false);
+	keymapper->getKeymap("choice-selection")->setEnabled(true);
+
 	do {
 		Common::Event key;
 		Common::EventType eventType = evtMan.processInput(&key);
@@ -182,11 +189,15 @@ int16 DialogMan::getChoice(uint16 choiceCount, uint16 dialogSetIndex, int16 driv
 		_vm->delay(1);
 		displMan.updateScreen();
 		if ((_selectedDialogChoice == 99) && (choiceCount == 1)
-			&& (eventType != Common::EVENT_INVALID) && key.kbd.keycode == Common::KEYCODE_RETURN) {
+			&& (eventType == Common::EVENT_CUSTOM_ENGINE_ACTION_START) && key.customType == kActionSelectChoice) {
 			/* If a choice has not been made yet with the mouse and the dialog has only one possible choice and carriage return was pressed on the keyboard */
 			_selectedDialogChoice = kDMDialogChoice1;
 		}
 	} while (_selectedDialogChoice == 99);
+
+	keymapper->getKeymap("choice-selection")->setEnabled(false);
+	keymapper->getKeymap("game-shortcuts")->setEnabled(true);
+
 	displMan._useByteBoxCoordinates = false;
 	Box boxA = evtMan._primaryMouseInput[_selectedDialogChoice - 1]._hitbox;
 	boxA._rect.left -= 3;
diff --git a/engines/dm/dm.h b/engines/dm/dm.h
index 1d972239862..fe62df76d7a 100644
--- a/engines/dm/dm.h
+++ b/engines/dm/dm.h
@@ -57,6 +57,24 @@ class ProjExpl;
 class DialogMan;
 class SoundMan;
 
+enum DMActions {
+	kActionNone,
+	kActionToggleInventoryChampion0,
+	kActionToggleInventoryChampion1,
+	kActionToggleInventoryChampion2,
+	kActionToggleInventoryChampion3,
+	kActionSave,
+	kActionFreezeGame,
+	kActionTurnLeft,
+	kActionMoveForward,
+	kActionTurnRight,
+	kActionMoveLeft,
+	kActionMoveBackward,
+	kActionMoveRight,
+	kActionWakeUp,
+	kActionSelectChoice,
+};
+
 enum Direction {
 	kDMDirNorth = 0,
 	kDMDirEast = 1,
diff --git a/engines/dm/eventman.cpp b/engines/dm/eventman.cpp
index 8622f59e32d..03e418f6776 100644
--- a/engines/dm/eventman.cpp
+++ b/engines/dm/eventman.cpp
@@ -47,47 +47,35 @@ namespace DM {
 void EventManager::initArrays() {
 	KeyboardInput primaryKeyboardInputInterface[7] = { // @ G0458_as_Graphic561_PrimaryKeyboardInput_Interface
 		/* { Command, Code } */
-		KeyboardInput(kDMCommandToggleInventoryChampion0, Common::KEYCODE_F1, 0), /* F1 (<CSI>1~) Atari ST: Code = 0x3B00 */
-		KeyboardInput(kDMCommandToggleInventoryChampion1, Common::KEYCODE_F2, 0), /* F2 (<CSI>2~) Atari ST: Code = 0x3C00 */
-		KeyboardInput(kDMCommandToggleInventoryChampion2, Common::KEYCODE_F3, 0), /* F3 (<CSI>3~) Atari ST: Code = 0x3D00 */
-		KeyboardInput(kDMCommandToggleInventoryChampion3, Common::KEYCODE_F4, 0), /* F4 (<CSI>4~) Atari ST: Code = 0x3E00 */
-		KeyboardInput(kDMCommandSaveGame, Common::KEYCODE_s, Common::KBD_CTRL), /* CTRL-S       Atari ST: Code = 0x0013 */
-		KeyboardInput(kDMCommandFreezeGame, Common::KEYCODE_ESCAPE, 0), /* Esc (0x1B)   Atari ST: Code = 0x001B */
-		KeyboardInput(kDMCommandNone, Common::KEYCODE_INVALID, 0)
+		KeyboardInput(kDMCommandToggleInventoryChampion0, kActionToggleInventoryChampion0), /* F1 (<CSI>1~) Atari ST: Code = 0x3B00 */
+		KeyboardInput(kDMCommandToggleInventoryChampion1, kActionToggleInventoryChampion1), /* F2 (<CSI>2~) Atari ST: Code = 0x3C00 */
+		KeyboardInput(kDMCommandToggleInventoryChampion2, kActionToggleInventoryChampion2), /* F3 (<CSI>3~) Atari ST: Code = 0x3D00 */
+		KeyboardInput(kDMCommandToggleInventoryChampion3, kActionToggleInventoryChampion3), /* F4 (<CSI>4~) Atari ST: Code = 0x3E00 */
+		KeyboardInput(kDMCommandSaveGame, kActionSave), /* CTRL-S       Atari ST: Code = 0x0013 */
+		KeyboardInput(kDMCommandFreezeGame, kActionFreezeGame), /* Esc (0x1B)   Atari ST: Code = 0x001B */
+		KeyboardInput(kDMCommandNone, kActionNone)
 	};
 
 	KeyboardInput secondaryKeyboardInputMovement[19] = { // @ G0459_as_Graphic561_SecondaryKeyboardInput_Movement
 		/* { Command, Code } */
-		KeyboardInput(kDMCommandTurnLeft, Common::KEYCODE_KP4, 0), /* Numeric pad 4 Atari ST: Code = 0x5200 */
-		KeyboardInput(kDMCommandMoveForward, Common::KEYCODE_KP5, 0), /* Numeric pad 5 Atari ST: Code = 0x4800 */
-		KeyboardInput(kDMCommandTurnRight, Common::KEYCODE_KP6, 0), /* Numeric pad 6 Atari ST: Code = 0x4700 */
-		KeyboardInput(kDMCommandMoveLeft, Common::KEYCODE_KP1, 0), /* Numeric pad 1 Atari ST: Code = 0x4B00 */
-		KeyboardInput(kDMCommandMoveBackward, Common::KEYCODE_KP2, 0), /* Numeric pad 2 Atari ST: Code = 0x5000 */
-		KeyboardInput(kDMCommandMoveRight, Common::KEYCODE_KP3, 0), /* Numeric pad 3 Atari ST: Code = 0x4D00. Remaining entries below not present */
-		KeyboardInput(kDMCommandMoveForward, Common::KEYCODE_w, 0), /* Up Arrow (<CSI>A) */ /*Differs for testing convenience*/
-		KeyboardInput(kDMCommandMoveForward, Common::KEYCODE_w, Common::KBD_SHIFT), /* Shift Up Arrow (<CSI>T) */ /*Differs for testing convenience*/
-		KeyboardInput(kDMCommandMoveLeft, Common::KEYCODE_a, 0), /* Backward Arrow (<CSI>D) */ /*Differs for testing convenience*/
-		KeyboardInput(kDMCommandMoveLeft, Common::KEYCODE_a, Common::KBD_SHIFT), /* Shift Forward Arrow (<CSI> A) */ /*Differs for testing convenience*/
-		KeyboardInput(kDMCommandMoveRight, Common::KEYCODE_d, 0), /* Forward Arrow (<CSI>C) */ /*Differs for testing convenience*/
-		KeyboardInput(kDMCommandMoveRight, Common::KEYCODE_d, Common::KBD_SHIFT), /* Shift Backward Arrow (<CSI> @) */ /*Differs for testing convenience*/
-		KeyboardInput(kDMCommandMoveBackward, Common::KEYCODE_s, 0), /* Down arrow (<CSI>B) */ /*Differs for testing convenience*/
-		KeyboardInput(kDMCommandMoveBackward, Common::KEYCODE_s, Common::KBD_SHIFT), /* Shift Down arrow (<CSI>S) */ /*Differs for testing convenience*/
-		KeyboardInput(kDMCommandTurnLeft, Common::KEYCODE_q, 0), /* Del (0x7F) */ /*Differs for testing convenience*/
-		KeyboardInput(kDMCommandTurnLeft, Common::KEYCODE_q, Common::KBD_SHIFT), /* Shift Del (0x7F) */ /*Differs for testing convenience*/
-		KeyboardInput(kDMCommandTurnRight, Common::KEYCODE_e, 0), /* Help (<CSI>?~) */ /*Differs for testing convenience*/
-		KeyboardInput(kDMCommandTurnRight, Common::KEYCODE_e, Common::KBD_SHIFT), /* Shift Help (<CSI>?~) */ /*Differs for testing convenience*/
-		KeyboardInput(kDMCommandNone, Common::KEYCODE_INVALID, 0)
+		KeyboardInput(kDMCommandTurnLeft, kActionTurnLeft), /* Numeric pad 4 Atari ST: Code = 0x5200 */
+		KeyboardInput(kDMCommandMoveForward, kActionMoveForward), /* Numeric pad 5 Atari ST: Code = 0x4800 */
+		KeyboardInput(kDMCommandTurnRight, kActionTurnRight), /* Numeric pad 6 Atari ST: Code = 0x4700 */
+		KeyboardInput(kDMCommandMoveLeft, kActionMoveLeft), /* Numeric pad 1 Atari ST: Code = 0x4B00 */
+		KeyboardInput(kDMCommandMoveBackward, kActionMoveBackward), /* Numeric pad 2 Atari ST: Code = 0x5000 */
+		KeyboardInput(kDMCommandMoveRight, kActionMoveRight), /* Numeric pad 3 Atari ST: Code = 0x4D00. Remaining entries below not present */
+		KeyboardInput(kDMCommandNone, kActionNone)
 	};
 	KeyboardInput primaryKeyboardInputPartySleeping[3] = { // @ G0460_as_Graphic561_PrimaryKeyboardInput_PartySleeping
 		/* { Command, Code } */
-		KeyboardInput(kDMCommandWakeUp, Common::KEYCODE_RETURN, 0), /* Return */
-		KeyboardInput(kDMCommandFreezeGame, Common::KEYCODE_ESCAPE, 0), /* Esc */
-		KeyboardInput(kDMCommandNone, Common::KEYCODE_INVALID, 0)
+		KeyboardInput(kDMCommandWakeUp, kActionWakeUp), /* Return */
+		KeyboardInput(kDMCommandFreezeGame, kActionFreezeGame), /* Esc */
+		KeyboardInput(kDMCommandNone, kActionNone)
 	};
 	KeyboardInput primaryKeyboardInputFrozenGame[2] = { // @ G0461_as_Graphic561_PrimaryKeyboardInput_FrozenGame
 		/* { Command, Code } */
-		KeyboardInput(kDMCommandUnfreezeGame, Common::KEYCODE_ESCAPE, 0), /* Esc */
-		KeyboardInput(kDMCommandNone, Common::KEYCODE_INVALID, 0)
+		KeyboardInput(kDMCommandUnfreezeGame, kActionFreezeGame), /* Esc */
+		KeyboardInput(kDMCommandNone, kActionNone)
 	};
 	MouseInput primaryMouseInputEntrance[4] = { // @ G0445_as_Graphic561_PrimaryMouseInput_Entrance[4]
 		/* { Command, Box.X1, Box.X2, Box.Y1, Box.Y2, Button } */
@@ -617,11 +605,17 @@ Common::EventType EventManager::processInput(Common::Event *grabKey, Common::Eve
 				*grabKey = event;
 				return event.type;
 			}
-
+			break;
+		}
+		case Common::EVENT_CUSTOM_ENGINE_ACTION_START: {
+			if (grabKey) {
+				*grabKey = event;
+				return event.type;
+			}
 			if (_primaryKeyboardInput) {
 				KeyboardInput *input = _primaryKeyboardInput;
 				while (input->_commandToIssue != kDMCommandNone) {
-					if ((input->_key == event.kbd.keycode) && (input->_modifiers == (event.kbd.flags & input->_modifiers))) {
+					if (input->_action == event.customType) {
 						processPendingClick(); // possible fix to BUG0_73
 						_commandQueue.push(Command(Common::Point(-1, -1), input->_commandToIssue));
 						break;
@@ -633,7 +627,7 @@ Common::EventType EventManager::processInput(Common::Event *grabKey, Common::Eve
 			if (_secondaryKeyboardInput) {
 				KeyboardInput *input = _secondaryKeyboardInput;
 				while (input->_commandToIssue != kDMCommandNone) {
-					if ((input->_key == event.kbd.keycode) && (input->_modifiers == (event.kbd.flags & input->_modifiers))) {
+					if (input->_action == event.customType) {
 						processPendingClick(); // possible fix to BUG0_73
 						_commandQueue.push(Command(Common::Point(-1, -1), input->_commandToIssue));
 						break;
diff --git a/engines/dm/eventman.h b/engines/dm/eventman.h
index 16d9db4c8c1..2f81ce82fee 100644
--- a/engines/dm/eventman.h
+++ b/engines/dm/eventman.h
@@ -179,11 +179,10 @@ public:
 class KeyboardInput {
 public:
 	CommandType _commandToIssue;
-	Common::KeyCode _key;
-	byte _modifiers;
+	Common::CustomEventType _action;
 
-	KeyboardInput(CommandType command, Common::KeyCode keycode, byte modifierFlags) : _commandToIssue(command), _key(keycode), _modifiers(modifierFlags) {}
-	KeyboardInput() : _commandToIssue(kDMCommandNone), _key(Common::KEYCODE_ESCAPE), _modifiers(0) {}
+	KeyboardInput(CommandType command, Common::CustomEventType action) : _commandToIssue(command), _action(action) {}
+	KeyboardInput() : _commandToIssue(kDMCommandNone), _action(kActionNone) {}
 }; // @ KEYBOARD_INPUT
 
 class DMEngine;
diff --git a/engines/dm/metaengine.cpp b/engines/dm/metaengine.cpp
index 9df8f0ea8be..38b6c6ff9df 100644
--- a/engines/dm/metaengine.cpp
+++ b/engines/dm/metaengine.cpp
@@ -28,11 +28,16 @@
 #include "common/error.h"
 #include "common/fs.h"
 #include "common/system.h"
+#include "common/translation.h"
 
 #include "engines/advancedDetector.h"
 
 #include "dm/dm.h"
 
+#include "backends/keymapper/action.h"
+#include "backends/keymapper/keymapper.h"
+#include "backends/keymapper/standard-actions.h"
+
 namespace DM {
 
 class DMMetaEngine : public AdvancedMetaEngine<DMADGameDescription> {
@@ -108,9 +113,153 @@ public:
 	}
 
 	bool removeSaveState(const char *target, int slot) const override { return false; }
-
+	Common::KeymapArray initKeymaps(const char *target) const override;
 };
 
+
+Common::KeymapArray DMMetaEngine::initKeymaps(const char *target) const {
+	using namespace Common;
+	using namespace DM;
+
+	Keymap *engineKeyMap = new Keymap(Keymap::kKeymapTypeGame, "dm-default", _("Default keymappings"));
+	Keymap *choiceSelectionKeyMap = new Keymap(Keymap::kKeymapTypeGame, "choice-selection", _("Dialog choice selection keymappings"));
+	Keymap *gameKeyMap = new Keymap(Keymap::kKeymapTypeGame, "game-shortcuts", _("Game keymappings"));
+
+	Action *act;
+
+	act = new Action(kStandardActionLeftClick, _("Select / Interact"));
+	act->setLeftClickEvent();
+	act->addDefaultInputMapping("MOUSE_LEFT");
+	act->addDefaultInputMapping("JOY_A");
+	engineKeyMap->addAction(act);
+
+	// I18N: (Game name: Dungeon Master) The player has a team of 4 characters called "champions" which they choose themselves. One of them can be assigned the "leader". This action toggles the inventory screen of the leader champion.
+	act = new Action(kStandardActionRightClick, _("Toggle leader inventory"));
+	act->setRightClickEvent();
+	act->addDefaultInputMapping("MOUSE_RIGHT");
+	act->addDefaultInputMapping("JOY_B");
+	engineKeyMap->addAction(act);
+
+	// I18N: (Game name: Dungeon Master) The game has multi-choice dialogs. If there is only one choice, then this action can be used to select it.
+	act = new Action("SELECTCHOICE", _("Select dialog choice (only works if there is a single choice)"));
+	act->setCustomEngineActionEvent(kActionSelectChoice);
+	act->addDefaultInputMapping("RETURN");
+	act->addDefaultInputMapping("JOY_X");
+	choiceSelectionKeyMap->addAction(act);
+
+	// I18N: (Game name: Dungeon Master) The player has a team of 4 characters called "champions" which they choose themselves. This action toggles the inventory screen of champion 1.
+	act = new Action("CHAMPION1INV", _("Toggle champion 1 inventory"));
+	act->setCustomEngineActionEvent(kActionToggleInventoryChampion0);
+	act->addDefaultInputMapping("F1"); // F1 (<CSI>1~) Atari ST: Code = 0x3B00
+	gameKeyMap->addAction(act);
+
+	// I18N: (Game name: Dungeon Master) The player has a team of 4 characters called "champions" which they choose themselves. This action toggles the inventory screen of champion 2.
+	act = new Action("CHAMPION2INV", _("Toggle champion 2 inventory"));
+	act->setCustomEngineActionEvent(kActionToggleInventoryChampion1);
+	act->addDefaultInputMapping("F2"); // F2 (<CSI>2~) Atari ST: Code = 0x3C00
+	gameKeyMap->addAction(act);
+
+	// I18N: (Game name: Dungeon Master) The player has a team of 4 characters called "champions" which they choose themselves. This action toggles the inventory screen of champion 3.
+	act = new Action("CHAMPION3INV", _("Toggle champion 3 inventory"));
+	act->setCustomEngineActionEvent(kActionToggleInventoryChampion2);
+	act->addDefaultInputMapping("F3"); // F3 (<CSI>3~) Atari ST: Code = 0x3D00
+	gameKeyMap->addAction(act);
+
+	// I18N: (Game name: Dungeon Master) The player has a team of 4 characters called "champions" which they choose themselves. This action toggles the inventory screen of champion 4.
+	act = new Action("CHAMPION4INV", _("Toggle champion 4 inventory"));
+	act->setCustomEngineActionEvent(kActionToggleInventoryChampion3);
+	act->addDefaultInputMapping("F4"); // F4 (<CSI>4~) Atari ST: Code = 0x3E00
+	gameKeyMap->addAction(act);
+
+	act = new Action("SAVEGAME", _("Save game"));
+	act->setCustomEngineActionEvent(kActionSave);
+	act->addDefaultInputMapping("C+s"); // CTRL-S       Atari ST: Code = 0x0013
+	act->addDefaultInputMapping("JOY_X");
+	gameKeyMap->addAction(act);
+
+	act = new Action("FREEZE", _("Pause"));
+	act->setCustomEngineActionEvent(kActionFreezeGame);
+	act->addDefaultInputMapping("ESCAPE"); // Esc (0x1B)   Atari ST: Code = 0x001B
+	act->addDefaultInputMapping("JOY_Y");
+	gameKeyMap->addAction(act);
+
+	act = new Action("TURNLEFT", _("Turn left"));
+	act->setCustomEngineActionEvent(kActionTurnLeft);
+	act->addDefaultInputMapping("KP4"); // Numeric pad 4 Atari ST: Code = 0x5200
+	act->addDefaultInputMapping("q"); // Added for convenience
+	act->addDefaultInputMapping("S+q"); // Added for convenience
+	act->addDefaultInputMapping("DELETE"); // Del (0x7F)
+	act->addDefaultInputMapping("S+DELETE"); // Shift Del (0x7F)
+	act->addDefaultInputMapping("JOY_LEFT_SHOULDER");
+	gameKeyMap->addAction(act);
+
+	act = new Action("MOVEFORWARD", _("Move forward"));
+	act->setCustomEngineActionEvent(kActionMoveForward);
+	act->addDefaultInputMapping("KP4"); // Numeric pad 5 Atari ST: Code = 0x4800
+	act->addDefaultInputMapping("w"); // Added for convenience
+	act->addDefaultInputMapping("S+w"); // Added for convenience
+	act->addDefaultInputMapping("UP"); // Up Arrow (<CSI>A)
+	act->addDefaultInputMapping("S+UP"); // Shift Up Arrow (<CSI>T)
+	act->addDefaultInputMapping("JOY_UP");
+	gameKeyMap->addAction(act);
+
+	act = new Action("TURNRIGHT", _("Turn right"));
+	act->setCustomEngineActionEvent(kActionTurnRight);
+	act->addDefaultInputMapping("KP6"); // Numeric pad 6 Atari ST: Code = 0x4700
+	act->addDefaultInputMapping("e"); // Added for convenience
+	act->addDefaultInputMapping("S+e"); // Added for convenience
+	act->addDefaultInputMapping("HELP"); // Help (<CSI>?~)
+	act->addDefaultInputMapping("S+HELP"); // Shift Help (<CSI>?~)
+	act->addDefaultInputMapping("JOY_RIGHT_SHOULDER");
+	gameKeyMap->addAction(act);
+
+	act = new Action("MOVELEFT", _("Strafe left"));
+	act->setCustomEngineActionEvent(kActionMoveLeft);
+	act->addDefaultInputMapping("KP1"); // Numeric pad 1 Atari ST: Code = 0x4B00
+	act->addDefaultInputMapping("a"); // Added for convenience
+	act->addDefaultInputMapping("S+a"); // Added for convenience
+	act->addDefaultInputMapping("LEFT"); // Backward Arrow (<CSI>D)
+	act->addDefaultInputMapping("S+LEFT"); // Shift Backward Arrow (<CSI>V)
+	act->addDefaultInputMapping("JOY_LEFT");
+	gameKeyMap->addAction(act);
+
+	act = new Action("MOVEBACKWARD", _("Move backward"));
+	act->setCustomEngineActionEvent(kActionMoveBackward);
+	act->addDefaultInputMapping("KP2"); // Numeric pad 2 Atari ST: Code = 0x5000
+	act->addDefaultInputMapping("s"); // Added for convenience
+	act->addDefaultInputMapping("S+s"); // Added for convenience
+	act->addDefaultInputMapping("DOWN"); // Down Arrow (<CSI>B)
+	act->addDefaultInputMapping("S+DOWN"); // Shift Down Arrow (<CSI>S)
+	act->addDefaultInputMapping("JOY_DOWN");
+	gameKeyMap->addAction(act);
+
+	act = new Action("MOVERIGHT", _("Strafe right"));
+	act->setCustomEngineActionEvent(kActionMoveRight);
+	act->addDefaultInputMapping("KP3"); // Numeric pad 3 Atari ST: Code = 0x4D00.
+	act->addDefaultInputMapping("d"); // Added for convenience
+	act->addDefaultInputMapping("S+d"); // Added for convenience
+	act->addDefaultInputMapping("RIGHT"); // Forward Arrow (<CSI>C)
+	act->addDefaultInputMapping("S+RIGHT"); // Shift Forward Arrow (<CSI>U)
+	act->addDefaultInputMapping("JOY_RIGHT");
+	gameKeyMap->addAction(act);
+
+	// I18N: (Game name: Dungeon Master) The player has a team of 4 characters called "champions" which they choose themselves. The champions can be put to sleep. This action wakes up the sleeping champion.
+	act = new Action("WAKEUPCHAMPION", _("Wake up champion"));
+	act->setCustomEngineActionEvent(kActionWakeUp);
+	act->addDefaultInputMapping("RETURN");
+	gameKeyMap->addAction(act);
+
+	KeymapArray keymaps(3);
+
+	keymaps[0] = engineKeyMap;
+	keymaps[1] = choiceSelectionKeyMap;
+	keymaps[2] = gameKeyMap;
+
+	choiceSelectionKeyMap->setEnabled(false);
+
+	return keymaps;
+}
+
 } // End of namespace DM
 
 #if PLUGIN_ENABLED_DYNAMIC(DM)




More information about the Scummvm-git-logs mailing list