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

bluegr noreply at scummvm.org
Sun Aug 17 16:05:17 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:
a9e1ed6bbd DRASCULA: Add keymapper support


Commit: a9e1ed6bbd6f8b83b5aa13cec28ac270dd960bb3
    https://github.com/scummvm/scummvm/commit/a9e1ed6bbd6f8b83b5aa13cec28ac270dd960bb3
Author: aunnoman1 (aunnoman123 at outlook.com)
Date: 2025-08-17T19:05:14+03:00

Commit Message:
DRASCULA: Add keymapper support

Changed paths:
    engines/drascula/animation.cpp
    engines/drascula/converse.cpp
    engines/drascula/drascula.cpp
    engines/drascula/drascula.h
    engines/drascula/graphics.cpp
    engines/drascula/interface.cpp
    engines/drascula/metaengine.cpp
    engines/drascula/saveload.cpp
    engines/drascula/talk.cpp


diff --git a/engines/drascula/animation.cpp b/engines/drascula/animation.cpp
index 4f2b225ac86..34526326dc6 100644
--- a/engines/drascula/animation.cpp
+++ b/engines/drascula/animation.cpp
@@ -23,6 +23,8 @@
 
 #include "common/text-to-speech.h"
 
+#include "backends/keymapper/keymapper.h"
+
 namespace Drascula {
 
 void DrasculaEngine::updateAnim(int y, int destX, int destY, int width, int height, int count, byte* src, int delayVal, bool copyRectangle) {
@@ -46,34 +48,38 @@ void DrasculaEngine::updateAnim(int y, int destX, int destY, int width, int heig
 void DrasculaEngine::animation_1_1() {
 	debug(4, "animation_1_1()");
 
+	Common::Keymapper *keymapper = g_system->getEventManager()->getKeymapper();
+	keymapper->getKeymap("game-shortcuts")->setEnabled(false);
+	keymapper->getKeymap("animation")->setEnabled(true);
+
 	while (term_int == 0 && !shouldQuit()) {
 		playMusic(29);
 		playFLI("logoddm.bin", 9);
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		delay(600);
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		clearRoom();
 		delay(340);
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		playMusic(26);
 		delay(500);
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		playFLI("logoalc.bin", 8);
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		clearRoom();
 		loadPic("cielo.alg", screenSurface, COMPLETE_PAL);
 		black();
 		updateScreen();
 		fadeFromBlack(2);
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		delay(900);
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		color_abc(kColorRed);
 		centerText(_textmisc[1], 160, 100);
@@ -81,13 +87,13 @@ void DrasculaEngine::animation_1_1() {
 		sayText(_textmisc[1], Common::TextToSpeechManager::INTERRUPT);
 
 		updateScreen();
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		delay(1000);
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		delay(1200);
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 
 		playFLI("scrollb.bin", 9);
@@ -101,10 +107,10 @@ void DrasculaEngine::animation_1_1() {
 			break;
 		loadPic("cielo2.alg", screenSurface, COMPLETE_PAL);
 		updateScreen();
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		fadeToBlack(1);
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		clearRoom();
 
@@ -114,10 +120,10 @@ void DrasculaEngine::animation_1_1() {
 		loadPic("aux104.alg", drawSurface2);
 
 		playMusic(4);
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		delay(400);
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 
 		for (int l2 = 0; l2 < 3; l2++) {
@@ -125,16 +131,16 @@ void DrasculaEngine::animation_1_1() {
 				copyBackground();
 				copyBackground(interf_x[l], interf_y[l], 156, 45, 63, 31, drawSurface2, screenSurface);
 				updateScreen();
-				if (getScan() == Common::KEYCODE_ESCAPE || shouldQuit()) {
+				if (getAction() == kActionSkip || shouldQuit()) {
 					term_int = 1;
 					break;
 				}
 				pause(3);
 			}
-			if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+			if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 				break;
 		}
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 
 		for (int l = 0, l2 = 0, p = 0; l < 180; l++) {
@@ -151,17 +157,17 @@ void DrasculaEngine::animation_1_1() {
 			}
 			if (l2 == 7)
 				l2 = 0;
-			if (getScan() == Common::KEYCODE_ESCAPE  || shouldQuit()) {
+			if (getAction() == kActionSkip  || shouldQuit()) {
 				term_int = 1;
 				break;
 			}
 		}
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		copyBackground(0, 0, 0, 0, 320, 200, screenSurface, bgSurface);
 
 		talk_drascula_big(1);
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 
 		clearRoom();
@@ -181,14 +187,14 @@ void DrasculaEngine::animation_1_1() {
 		placeDrascula();
 		updateScreen();
 		talk_igor(8, kIgorDch);
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		copyBackground();
 		placeIgor();
 		placeDrascula();
 		updateScreen();
 		talk_drascula(2);
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		talk_drascula(3);
 		if (animate("lib.bin", 16))
@@ -201,7 +207,7 @@ void DrasculaEngine::animation_1_1() {
 		updateScreen();
 		pause(10);
 		talk_solo(_textd[4],"d4.als");
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		loadPic("plan1.alg", screenSurface, HALF_PAL);
 		updateScreen();
@@ -219,30 +225,30 @@ void DrasculaEngine::animation_1_1() {
 		loadPic("plan3.alg", screenSurface, HALF_PAL);
 		updateScreen();
 		pause(20);
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		talk_solo(_textd[7], "d7.als");
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		loadPic("plan3.alg", screenSurface, HALF_PAL);
 		updateScreen();
 		talk_solo(_textd[8], "d8.als");
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		clearRoom();
 		loadPic(100, bgSurface, HALF_PAL);
 		MusicFadeout();
 		stopMusic();
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		talk_igor(9, kIgorDch);
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		talk_drascula(9);
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		talk_igor(10, kIgorDch);
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		playMusic(11);
 		talk_drascula(10);
@@ -262,14 +268,14 @@ void DrasculaEngine::animation_1_1() {
 		black();
 		playMusic(23);
 		fadeFromBlack(0);
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		trackDrascula = 1;
 		talk_igor(1, kIgorDch);
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		talk_drascula(11, 1);
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		trackDrascula = 3;
 		copyBackground();
@@ -283,7 +289,7 @@ void DrasculaEngine::animation_1_1() {
 		placeDrascula();
 		updateScreen();
 		talk_drascula(12);
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		trackDrascula = 3;
 		copyBackground();
@@ -297,11 +303,11 @@ void DrasculaEngine::animation_1_1() {
 		placeDrascula();
 		updateScreen();
 		talk_igor(2, kIgorDch);
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		pause(13);
 		talk_drascula(13, 1);
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		trackDrascula = 3;
 		copyBackground();
@@ -315,35 +321,35 @@ void DrasculaEngine::animation_1_1() {
 		placeDrascula();
 		updateScreen();
 		talk_drascula(14);
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		talk_igor(3, kIgorDch);
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		talk_drascula(15);
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		talk_igor(4, kIgorDch);
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		talk_drascula(16);
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		talk_igor(5, kIgorDch);
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		trackIgor = 3;
 		talk_drascula(17);
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		pause(18);
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		talk_igor(6, kIgorFront);
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		fadeToBlack(0);
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		clearRoom();
 
@@ -356,6 +362,10 @@ void DrasculaEngine::animation_1_1() {
 		playFLI("intro.bin", 12);
 		term_int = 1;
 	}
+
+	keymapper->getKeymap("animation")->setEnabled(false);
+	keymapper->getKeymap("game-shortcuts")->setEnabled(true);
+
 	clearRoom();
 	loadPic(96, frontSurface, COMPLETE_PAL);
 	loadPic(99, backSurface);
@@ -366,6 +376,10 @@ void DrasculaEngine::animation_2_1() {
 
 	int l;
 
+	Common::Keymapper *keymapper = g_system->getEventManager()->getKeymapper();
+	keymapper->getKeymap("game-shortcuts")->setEnabled(false);
+	keymapper->getKeymap("animation")->setEnabled(true);
+
 	walkToPoint(Common::Point(231, 91));
 	_characterVisible = false;
 
@@ -376,22 +390,22 @@ void DrasculaEngine::animation_2_1() {
 			break;
 
 		loadPic("an11y13.alg", extraSurface);
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 
 		talk_bartender(22);
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 
 		loadPic(97, extraSurface);
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 
 		pause(4);
 		playSound(1);
 		hiccup(18);
 		finishSound();
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 
 		clearRoom();
@@ -401,36 +415,36 @@ void DrasculaEngine::animation_2_1() {
 		color_solo = kColorWhite;
 		pause(80);
 
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		talk_solo(_textbj[1], "BJ1.als");
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		clearRoom();
 		loadPic("bj.alg", screenSurface, HALF_PAL);
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		black();
 		updateScreen();
 		fadeFromBlack(1);
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		color_solo = kColorYellow;
 		talk_solo(_text[214], "214.als");
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		clearRoom();
 
 		loadPic(16, bgSurface, HALF_PAL);
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		loadPic("auxbj.alg", drawSurface3);
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 
 		_roomNumber = 16;
 
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		for (l = 0; l < 200; l++)
 			factor_red[l] = 99;
@@ -444,7 +458,7 @@ void DrasculaEngine::animation_2_1() {
 			break;
 
 		walkToPoint(Common::Point(100 + curWidth / 2, 99 + curHeight));
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		trackProtagonist = 1;
 		curX = 100;
@@ -458,42 +472,42 @@ void DrasculaEngine::animation_2_1() {
 			break;
 		playMusic(9);
 		loadPic(97, extraSurface);
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		updateRoom();
 		updateScreen();
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		pause(120);
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		talk_solo(_text[223], "223.als");
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		color_solo = kColorWhite;
 		updateRoom();
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		updateScreen();
 		pause(110);
 		talk_solo(_textbj[11], "BJ11.als");
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		updateRoom();
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		updateScreen();
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		pause(118);
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		walkToPoint(Common::Point(132, 97 + curHeight));
 		pause(60);
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		talk(224);
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		talk_bj(12);
 		walkToPoint(Common::Point(157, 98 + curHeight));
@@ -512,30 +526,32 @@ void DrasculaEngine::animation_2_1() {
 		// Also check animation_9_6(), where the same hack was used by
 		// the original
 		_roomNumber = -1;
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		pause(8);
 		updateRoom();
 		updateScreen();
 		talk(225);
 		pause(76);
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		trackProtagonist = 1;
 		updateRoom();
 		updateScreen();
 		talk(226);
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		updateRoom();
 		updateScreen();
 		pause(30);
-		if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit())
+		if ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit())
 			break;
 		talk(227);
 		fadeToBlack(0);
 		break;
 	}
+	keymapper->getKeymap("animation")->setEnabled(false);
+	keymapper->getKeymap("game-shortcuts")->setEnabled(true);
 }
 
 void DrasculaEngine::animation_3_1() {
@@ -757,7 +773,7 @@ void DrasculaEngine::animation_16_2() {
 	else
 		playMusic(32);
 
-	if (getScan() != 0) {
+	if (getScan() != 0 || getAction() != kActionNone) {
 		asco();
 		return;
 	}
@@ -777,7 +793,7 @@ void DrasculaEngine::animation_16_2() {
 		centerText(_texthis[i], 180, 180);
 		updateScreen();
 
-		if (getScan() != 0) {
+		if (getScan() != 0 || getAction() != kActionNone) {
 			asco();
 			return;
 		}
@@ -785,7 +801,7 @@ void DrasculaEngine::animation_16_2() {
 		uint32 now = _system->getMillis();
 		while (_system->getMillis() - now < 3000 * 2) {
 			delay(50);
-			if (getScan() != 0) {
+			if (getScan() != 0 || getAction() != kActionNone) {
 				asco();
 				return;
 			}
@@ -794,7 +810,7 @@ void DrasculaEngine::animation_16_2() {
 		if (i < 4) {
 			fadeToBlack(1);
 			clearRoom();
-			if (getScan() != 0) {
+			if (getScan() != 0 || getAction() != kActionNone) {
 				asco();
 				return;
 			}
@@ -809,7 +825,7 @@ void DrasculaEngine::animation_16_2() {
 		copyBackground(0, 200 - l, 0, 0, 320, l, bgSurface, screenSurface);
 		delay(10);
 		updateScreen();
-		if (getScan() != 0) {
+		if (getScan() != 0 || getAction() != kActionNone) {
 			asco();
 			return;
 		}
diff --git a/engines/drascula/converse.cpp b/engines/drascula/converse.cpp
index 589cca51261..3e045cb81b5 100644
--- a/engines/drascula/converse.cpp
+++ b/engines/drascula/converse.cpp
@@ -228,6 +228,7 @@ void DrasculaEngine::converse(int index) {
 
 		updateEvents();
 		flushKeyBuffer();
+		flushActionBuffer();
 
 		phrase1_bottom = 8 * print_abc_opc(phrase1, 2, game1);
 		phrase2_bottom = phrase1_bottom + 8 * print_abc_opc(phrase2, phrase1_bottom + 2, game2);
diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp
index 4a8a6f2fae2..aeccc822cbc 100644
--- a/engines/drascula/drascula.cpp
+++ b/engines/drascula/drascula.cpp
@@ -175,6 +175,8 @@ DrasculaEngine::DrasculaEngine(OSystem *syst, const DrasculaGameDescription *gam
 
 	_keyBufferHead = _keyBufferTail = 0;
 
+	_actionBufferHead = _actionBufferTail = 0;
+
 	_roomHandlers = nullptr;
 }
 
@@ -664,30 +666,31 @@ bool DrasculaEngine::runCurrentChapter() {
 
 		_canSaveLoad = true;
 		Common::KeyCode key = getScan();
+		Common::CustomEventType action = getAction();
 		_canSaveLoad = false;
 		if (_loadedDifferentChapter)
 			return true;
-		if (key == Common::KEYCODE_F1 && !_menuScreen) {
+		if (action == kActionLook && !_menuScreen) {
 			selectVerb(kVerbLook);
-		} else if (key == Common::KEYCODE_F2 && !_menuScreen) {
+		} else if (action == kActionPick && !_menuScreen) {
 			selectVerb(kVerbPick);
-		} else if (key == Common::KEYCODE_F3 && !_menuScreen) {
+		} else if (action == kActionOpen && !_menuScreen) {
 			selectVerb(kVerbOpen);
-		} else if (key == Common::KEYCODE_F4 && !_menuScreen) {
+		} else if (action == kActionClose && !_menuScreen) {
 			selectVerb(kVerbClose);
-		} else if (key == Common::KEYCODE_F5 && !_menuScreen) {
+		} else if (action == kActionTalk && !_menuScreen) {
 			selectVerb(kVerbTalk);
-		} else if (key == Common::KEYCODE_F6 && !_menuScreen) {
+		} else if (action == kActionMove && !_menuScreen) {
 			selectVerb(kVerbMove);
-		} else if (key == Common::KEYCODE_F7) {
+		} else if (action == kActionLoadGame) {
 			// ScummVM load screen
 			if (!scummVMSaveLoadDialog(false))
 				return true;
-		} else if (key == Common::KEYCODE_F8) {
+		} else if (action == kActionVerbReset) {
 			selectVerb(kVerbNone);
-		} else if (key == Common::KEYCODE_F9) {
+		} else if (action == kActionVolumeControls) {
 			volumeControls();
-		} else if (key == Common::KEYCODE_F10) {
+		} else if (action == kActionSaveGame) {
 			if (!ConfMan.getBool("originalsaveload")) {
 				// ScummVM save screen
 				scummVMSaveLoadDialog(true);
@@ -696,7 +699,7 @@ bool DrasculaEngine::runCurrentChapter() {
 				if (!saveLoadScreen())
 					return true;
 			}
-		} else if (key == Common::KEYCODE_v) {
+		} else if (action == kActionSubtitlesEnable) {
 			_subtitlesDisabled = true;
 			ConfMan.setBool("subtitles", !_subtitlesDisabled);
 
@@ -706,7 +709,7 @@ bool DrasculaEngine::runCurrentChapter() {
 
 			updateScreen();
 			delay(1410);
-		} else if (key == Common::KEYCODE_t) {
+		} else if (action == kActionSubtitlesDisable) {
 			_subtitlesDisabled = false;
 			ConfMan.setBool("subtitles", !_subtitlesDisabled);
 
@@ -716,14 +719,14 @@ bool DrasculaEngine::runCurrentChapter() {
 
 			updateScreen();
 			delay(1460);
-		} else if (key == Common::KEYCODE_ESCAPE) {
+		} else if (action == kActionQuit) {
 			if (!confirmExit())
 				return false;
-		} else if (currentChapter == 6 && key == Common::KEYCODE_0 && _roomNumber == 61) {
+		} else if (currentChapter == 6 && action == kActionEasterEgg && _roomNumber == 61) {
 			loadPic("alcbar.alg", bgSurface, 255);
 		}
 
-		if (_leftMouseButton != 0 || _rightMouseButton != 0 || key != 0)
+		if (_leftMouseButton != 0 || _rightMouseButton != 0 || key != 0 || action != kActionNone)
 			framesWithoutAction = 0;
 
 		if (framesWithoutAction == 15000) {
@@ -833,6 +836,32 @@ void DrasculaEngine::flushKeyBuffer() {
 	_keyBufferHead = _keyBufferTail = 0;
 }
 
+Common::CustomEventType DrasculaEngine::getAction() {
+	updateEvents();
+	if (_actionBufferHead == _actionBufferTail)
+		return kActionNone;
+
+	Common::CustomEventType action = _actionBuffer[_actionBufferTail];
+	_actionBufferTail = (_actionBufferTail + 1) % ACTIONBUFSIZE;
+
+	return action;
+}
+
+void DrasculaEngine::addActionToBuffer(Common::CustomEventType& action) {
+	if ((_actionBufferHead + 1) % ACTIONBUFSIZE == _actionBufferTail) {
+		warning("action buffer overflow");
+		return;
+	}
+
+	_actionBuffer[_actionBufferHead] = action;
+	_actionBufferHead = (_actionBufferHead + 1) % ACTIONBUFSIZE;
+}
+
+void DrasculaEngine::flushActionBuffer() {
+	updateEvents();
+	_actionBufferHead = _actionBufferTail = 0;
+}
+
 void DrasculaEngine::updateEvents() {
 	Common::Event event;
 	Common::EventManager *eventMan = _system->getEventManager();
@@ -841,6 +870,11 @@ void DrasculaEngine::updateEvents() {
 
 	while (eventMan->pollEvent(event)) {
 		switch (event.type) {
+		case Common::EVENT_CUSTOM_ENGINE_ACTION_START:
+			addActionToBuffer(event.customType);
+			break;
+		case Common::EVENT_CUSTOM_ENGINE_ACTION_END:
+			break;
 		case Common::EVENT_KEYDOWN:
 			addKeyToBuffer(event.kbd);
 			break;
diff --git a/engines/drascula/drascula.h b/engines/drascula/drascula.h
index 1a9b3d72259..6784cf39c07 100644
--- a/engines/drascula/drascula.h
+++ b/engines/drascula/drascula.h
@@ -58,6 +58,27 @@ namespace Drascula {
 #define DRASCULA_DAT_VER 7
 #define DATAALIGNMENT 4
 
+enum DRASCULAActions {
+	kActionNone,
+	kActionSkip,
+	kActionLook,
+	kActionPick,
+	kActionOpen,
+	kActionClose,
+	kActionTalk,
+	kActionMove,
+	kActionLoadGame,
+	kActionVerbReset,
+	kActionVolumeControls,
+	kActionSaveGame,
+	kActionSubtitlesEnable,
+	kActionSubtitlesDisable,
+	kActionQuit,
+	kActionEasterEgg,
+	kActionPauseSpeech,
+	kActionConfirmQuit,
+};
+
 enum Languages {
 	kEnglish = 0,
 	kSpanish = 1,
@@ -307,6 +328,7 @@ public:
 #define HALF_PAL		128
 
 #define KEYBUFSIZE		16
+#define ACTIONBUFSIZE	16
 
 static const int interf_x[] = { 1, 65, 129, 193, 1, 65, 129 };
 static const int interf_y[] = { 51, 51, 51, 51, 83, 83, 83 };
@@ -471,6 +493,10 @@ public:
 	int _keyBufferHead;
 	int _keyBufferTail;
 
+	Common::CustomEventType _actionBuffer[ACTIONBUFSIZE];
+	int _actionBufferHead;
+	int _actionBufferTail;
+
 	bool loadDrasculaDat();
 
 	bool runCurrentChapter();
@@ -495,6 +521,9 @@ public:
 	Common::KeyCode getScan();
 	void addKeyToBuffer(Common::KeyState& key);
 	void flushKeyBuffer();
+	Common::CustomEventType getAction();
+	void addActionToBuffer(Common::CustomEventType& action);
+	void flushActionBuffer();
 	void selectVerb(int);
 	int updateVolume(int prevVolume, int prevVolumeY);
 	void volumeControls();
@@ -730,7 +759,7 @@ public:
 	void update_62();
 	void update_62_pre();
 	void update_102();
-	
+
 	void sayText(const Common::String &text, Common::TextToSpeechManager::Action action);
 
 private:
diff --git a/engines/drascula/graphics.cpp b/engines/drascula/graphics.cpp
index 9fd4090902f..d39d58f6f07 100644
--- a/engines/drascula/graphics.cpp
+++ b/engines/drascula/graphics.cpp
@@ -26,6 +26,8 @@
 #include "common/textconsole.h"
 #include "common/text-to-speech.h"
 
+#include "backends/keymapper/keymapper.h"
+
 namespace Drascula {
 
 void DrasculaEngine::allocMemory() {
@@ -87,7 +89,7 @@ void DrasculaEngine::moveCursor() {
 		centerText(textName, _mouseX, _mouseY);
 	} else if (!_menuBar && !_menuScreen)
 		_previousSaid.clear();
-	
+
 	if (_menuScreen)
 		showMenu();
 	else if (_menuBar)
@@ -557,6 +559,7 @@ void DrasculaEngine::playFLI(const char *filefli, int vel) {
 	globalSpeed = 1000 / vel;
 	FrameSSN = 0;
 	Common::SeekableReadStream *stream = _archives.open(filefli);
+	Common::Keymapper *keymapper = g_system->getEventManager()->getKeymapper();
 
 	if (!stream) {
 		warning("playFLI: Failed to load file '%s'", filefli);
@@ -564,11 +567,17 @@ void DrasculaEngine::playFLI(const char *filefli, int vel) {
 	}
 	LastFrame = _system->getMillis();
 
+	keymapper->getKeymap("game-shortcuts")->setEnabled(false);
+	keymapper->getKeymap("animation")->setEnabled(true);
+
 	while (playFrameSSN(stream) && (!term_int) && !shouldQuit()) {
-		if (getScan() == Common::KEYCODE_ESCAPE)
+		if (getAction() == kActionSkip)
 			term_int = 1;
 	}
 
+	keymapper->getKeymap("animation")->setEnabled(false);
+	keymapper->getKeymap("game-shortcuts")->setEnabled(true);
+
 	delete stream;
 }
 
@@ -709,6 +718,8 @@ bool DrasculaEngine::animate(const char *animationFile, int FPS) {
 
 	Common::SeekableReadStream *stream = _archives.open(animationFile);
 
+	Common::Keymapper *keymapper = g_system->getEventManager()->getKeymapper();
+
 	if (!stream) {
 		warning("Animation file %s not found", animationFile);
 		return true;
@@ -717,19 +728,27 @@ bool DrasculaEngine::animate(const char *animationFile, int FPS) {
 	NFrames = stream->readSint32LE();
 	showFrame(stream, true);
 	_system->delayMillis(1000 / FPS);
+
+	keymapper->getKeymap("game-shortcuts")->setEnabled(false);
+	keymapper->getKeymap("animation")->setEnabled(true);
+
 	while (cnt < NFrames) {
 		showFrame(stream);
 		_system->delayMillis(1000 / FPS);
 		cnt++;
 		byte key = getScan();
-		if (key == Common::KEYCODE_ESCAPE)
+		Common::CustomEventType action = getAction();
+		if (action == kActionSkip)
 			term_int = 1;
-		if (key != 0)
+		if (key != 0 || action != kActionNone)
 			break;
 	}
 	delete stream;
 
-	return ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE) || shouldQuit());
+	keymapper->getKeymap("animation")->setEnabled(false);
+	keymapper->getKeymap("game-shortcuts")->setEnabled(true);
+
+	return ((term_int == 1) || (getAction() == kActionSkip) || shouldQuit());
 }
 
 } // End of namespace Drascula
diff --git a/engines/drascula/interface.cpp b/engines/drascula/interface.cpp
index 68c4971011a..ce2a6002078 100644
--- a/engines/drascula/interface.cpp
+++ b/engines/drascula/interface.cpp
@@ -24,6 +24,8 @@
 
 #include "common/text-to-speech.h"
 
+#include "backends/keymapper/keymapper.h"
+
 // The verbs are represented in-game as a picture, thus we are
 // adding transcriptions here
 // While only English, Spanish, Italian, and Russian are translated in-game,
@@ -183,6 +185,8 @@ void DrasculaEngine::selectVerb(int verb) {
 
 bool DrasculaEngine::confirmExit() {
 	byte key = 0;
+	Common::CustomEventType action = kActionNone;
+	Common::Keymapper *keymapper = g_system->getEventManager()->getKeymapper();
 
 	color_abc(kColorRed);
 	updateRoom();
@@ -191,10 +195,14 @@ bool DrasculaEngine::confirmExit() {
 
 	sayText(_textsys[kConfirmExit], Common::TextToSpeechManager::INTERRUPT);
 
+	keymapper->getKeymap("game-shortcuts")->setEnabled(false);
+	keymapper->getKeymap("quit-dialog")->setEnabled(true);
+
 	delay(100);
 	while (!shouldQuit()) {
 		key = getScan();
-		if (key != 0)
+		action = getAction();
+		if (key != 0 || action != kActionNone)
 			break;
 
 		// This gives a better feedback to the user when he is asked to
@@ -207,7 +215,10 @@ bool DrasculaEngine::confirmExit() {
 		updateScreen();
 	}
 
-	if (key == Common::KEYCODE_ESCAPE || shouldQuit()) {
+	keymapper->getKeymap("quit-dialog")->setEnabled(false);
+	keymapper->getKeymap("game-shortcuts")->setEnabled(true);
+
+	if (action == kActionConfirmQuit || shouldQuit()) {
 		stopMusic();
 		return false;
 	}
@@ -272,7 +283,7 @@ void DrasculaEngine::clearMenu() {
 
 			sayText(verbNames[n], Common::TextToSpeechManager::INTERRUPT);
 		}
-		
+
 		copyRect(OBJWIDTH * n, OBJHEIGHT * verbActivated, _verbBarX[n], 2,
 						OBJWIDTH, OBJHEIGHT, cursorSurface, screenSurface);
 		verbActivated = 1;
diff --git a/engines/drascula/metaengine.cpp b/engines/drascula/metaengine.cpp
index dfb9af34fe9..df4596619c9 100644
--- a/engines/drascula/metaengine.cpp
+++ b/engines/drascula/metaengine.cpp
@@ -29,6 +29,10 @@
 #include "drascula/drascula.h"
 #include "drascula/detection.h"
 
+#include "backends/keymapper/action.h"
+#include "backends/keymapper/keymapper.h"
+#include "backends/keymapper/standard-actions.h"
+
 namespace Drascula {
 
 static const ADExtraGuiOptionsMap optionsList[] = {
@@ -106,6 +110,7 @@ public:
 	int getMaximumSaveSlot() const override;
 	bool removeSaveState(const char *target, int slot) const override;
 	SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const override;
+	Common::KeymapArray initKeymaps(const char *target) const override;
 };
 
 bool DrasculaMetaEngine::hasFeature(MetaEngineFeature f) const {
@@ -191,6 +196,148 @@ Common::Error DrasculaMetaEngine::createInstance(OSystem *syst, Engine **engine,
 	return Common::kNoError;
 }
 
+Common::KeymapArray DrasculaMetaEngine::initKeymaps(const char *target) const {
+	using namespace Common;
+	using namespace Drascula;
+
+	bool originalSaveLoad = ConfMan.getBool("originalsaveload", target);
+
+	Keymap *engineKeyMap = new Keymap(Keymap::kKeymapTypeGame, "drascula-default", _("Default keymappings"));
+	Keymap *gameKeyMap = new Keymap(Keymap::kKeymapTypeGame, "game-shortcuts", _("Game keymappings"));
+	Keymap *animationKeyMap = new Keymap(Keymap::kKeymapTypeGame, "animation", _("Animation keymappings"));
+	Keymap *quitDialogKeyMap = new Keymap(Keymap::kKeymapTypeGame, "quit-dialog", _("Quit dialog keymappings"));
+
+	Action *act;
+
+	act = new Action(kStandardActionLeftClick, _("Move / Interact / Select"));
+	act->setLeftClickEvent();
+	act->addDefaultInputMapping("MOUSE_LEFT");
+	act->addDefaultInputMapping("JOY_A");
+	engineKeyMap->addAction(act);
+
+	act = new Action(kStandardActionRightClick, _("Inventory"));
+	act->setRightClickEvent();
+	act->addDefaultInputMapping("MOUSE_RIGHT");
+	act->addDefaultInputMapping("JOY_B");
+	engineKeyMap->addAction(act);
+
+	act = new Action("SKIP", _("Skip"));
+	act->setCustomEngineActionEvent(kActionSkip);
+	act->addDefaultInputMapping("ESCAPE");
+	act->addDefaultInputMapping("JOY_X");
+	animationKeyMap->addAction(act);
+
+	act = new Action("LOOK", _("Look"));
+	act->setCustomEngineActionEvent(kActionLook);
+	act->addDefaultInputMapping("F1");
+	gameKeyMap->addAction(act);
+
+	act = new Action("PICK", _("Pick"));
+	act->setCustomEngineActionEvent(kActionPick);
+	act->addDefaultInputMapping("F2");
+	gameKeyMap->addAction(act);
+
+	act = new Action("OPEN", _("Open"));
+	act->setCustomEngineActionEvent(kActionOpen);
+	act->addDefaultInputMapping("F3");
+	gameKeyMap->addAction(act);
+
+	act = new Action("CLOSE", _("Close"));
+	act->setCustomEngineActionEvent(kActionClose);
+	act->addDefaultInputMapping("F4");
+	gameKeyMap->addAction(act);
+
+	act = new Action("TALK", _("Talk"));
+	act->setCustomEngineActionEvent(kActionTalk);
+	act->addDefaultInputMapping("F5");
+	gameKeyMap->addAction(act);
+
+	act = new Action("MOVE", _("Move"));
+	act->setCustomEngineActionEvent(kActionMove);
+	act->addDefaultInputMapping("F6");
+	gameKeyMap->addAction(act);
+
+	act = new Action("LOAD", _("Load game"));
+	act->setCustomEngineActionEvent(kActionLoadGame);
+	act->addDefaultInputMapping("F7");
+	act->addDefaultInputMapping("JOY_LEFT");
+	gameKeyMap->addAction(act);
+
+	act = new Action("RESETVERBS", _("Reset selected verb"));
+	act->setCustomEngineActionEvent(kActionVerbReset);
+	act->addDefaultInputMapping("F8");
+	act->addDefaultInputMapping("JOY_LEFT_TRIGGER");
+	gameKeyMap->addAction(act);
+
+	act = new Action("VOLCONTROLS", _("Volume controls"));
+	act->setCustomEngineActionEvent(kActionVolumeControls);
+	act->addDefaultInputMapping("F9");
+	act->addDefaultInputMapping("JOY_X");
+	gameKeyMap->addAction(act);
+
+	if (originalSaveLoad) {
+		act = new Action("SAVELOAD", _("Save / load game"));
+		act->setCustomEngineActionEvent(kActionSaveGame);
+		act->addDefaultInputMapping("F10");
+		act->addDefaultInputMapping("JOY_RIGHT");
+		gameKeyMap->addAction(act);
+	} else {
+		act = new Action("SAVE", _("Save game"));
+		act->setCustomEngineActionEvent(kActionSaveGame);
+		act->addDefaultInputMapping("F10");
+		act->addDefaultInputMapping("JOY_RIGHT");
+		gameKeyMap->addAction(act);
+	}
+
+	act = new Action("SUBTITLESENABLE", _("Enable subtitles"));
+	act->setCustomEngineActionEvent(kActionSubtitlesEnable);
+	act->addDefaultInputMapping("v");
+	act->addDefaultInputMapping("JOY_UP");
+	gameKeyMap->addAction(act);
+
+	act = new Action("SUBTITLESDISABLE", _("Disable subtitles"));
+	act->setCustomEngineActionEvent(kActionSubtitlesDisable);
+	act->addDefaultInputMapping("t");
+	act->addDefaultInputMapping("JOY_DOWN");
+	gameKeyMap->addAction(act);
+
+	act = new Action("QUIT", _("Quit"));
+	act->setCustomEngineActionEvent(kActionQuit);
+	act->addDefaultInputMapping("ESCAPE");
+	act->addDefaultInputMapping("JOY_RIGHT_TRIGGER");
+	gameKeyMap->addAction(act);
+
+	act = new Action(kStandardActionEE, _("???"));
+	act->setCustomEngineActionEvent(kActionEasterEgg);
+	act->addDefaultInputMapping("0");
+	gameKeyMap->addAction(act);
+
+	act = new Action("PAUSESPEECH", _("Pause speech"));
+	act->setCustomEngineActionEvent(kActionPauseSpeech);
+	act->addDefaultInputMapping("SPACE");
+	act->addDefaultInputMapping("PAUSE");
+	act->addDefaultInputMapping("JOY_Y");
+	gameKeyMap->addAction(act);
+
+	act = new Action("QUITCONFIRM", _("Confirm quit"));
+	act->setCustomEngineActionEvent(kActionConfirmQuit);
+	act->addDefaultInputMapping("ESCAPE");
+	act->addDefaultInputMapping("JOY_RIGHT_TRIGGER");
+	quitDialogKeyMap->addAction(act);
+
+	KeymapArray keymaps(4);
+
+	keymaps[0] = engineKeyMap;
+	keymaps[1] = gameKeyMap;
+	keymaps[2] = animationKeyMap;
+	keymaps[3] = quitDialogKeyMap;
+
+	animationKeyMap->setEnabled(false);
+	quitDialogKeyMap->setEnabled(false);
+
+	return keymaps;
+}
+
 } // End of namespace Drascula
 
 #if PLUGIN_ENABLED_DYNAMIC(DRASCULA)
diff --git a/engines/drascula/saveload.cpp b/engines/drascula/saveload.cpp
index d73df33dc00..e4d032cc872 100644
--- a/engines/drascula/saveload.cpp
+++ b/engines/drascula/saveload.cpp
@@ -30,6 +30,8 @@
 
 #include "drascula/drascula.h"
 
+#include "backends/keymapper/keymapper.h"
+
 namespace Drascula {
 
 #define MAGIC_HEADER 0xD6A55A57		// (D)rascula (GA)me (S)cummVM (SA)ve (ST)ate
@@ -344,8 +346,11 @@ bool DrasculaEngine::loadGame(int slot) {
 Common::String DrasculaEngine::enterName(Common::String &selectedName) {
 	Common::KeyCode key;
 	Common::String inputLine = selectedName;
+	Common::Keymapper *keymapper = g_system->getEventManager()->getKeymapper();
 
 	flushKeyBuffer();
+	flushActionBuffer();
+	keymapper->getKeymap("game-shortcuts")->setEnabled(false);
 	_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, true);
 
 	while (!shouldQuit()) {
@@ -371,6 +376,7 @@ Common::String DrasculaEngine::enterName(Common::String &selectedName) {
 		}
 	}
 
+	keymapper->getKeymap("game-shortcuts")->setEnabled(true);
 	_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, false);
 	return inputLine;
 }
diff --git a/engines/drascula/talk.cpp b/engines/drascula/talk.cpp
index 3d6f34774cd..5cef9a6faa4 100644
--- a/engines/drascula/talk.cpp
+++ b/engines/drascula/talk.cpp
@@ -21,6 +21,8 @@
 
 #include "drascula/drascula.h"
 
+#include "backends/keymapper/keymapper.h"
+
 namespace Drascula {
 
 static const int x_talk_dch[6] = {1, 25, 49, 73, 97, 121};
@@ -39,14 +41,15 @@ bool DrasculaEngine::isTalkFinished() {
 	}
 
 	Common::KeyCode key = getScan();
-	if (key == Common::KEYCODE_SPACE || key == Common::KEYCODE_PAUSE) {
+	Common::CustomEventType action = getAction();
+	if (action == kActionPauseSpeech) {
 		// Pause speech until space is pressed again
 		// Note: an alternative is to implement a PauseDialog as is done in engines/scumm/dialogs.cpp
 		do {
 			pause(10);
-			key = getScan();
-		} while (key != Common::KEYCODE_SPACE && key != Common::KEYCODE_PAUSE && !shouldQuit());
-	} else if (key != 0)
+			action = getAction();
+		} while (action != kActionPauseSpeech && !shouldQuit());
+	} else if (key != 0 || action != kActionNone)
 		stopSound();
 	if (soundIsActive())
 		return false;
@@ -207,11 +210,15 @@ void DrasculaEngine::talk_drascula_big(int index) {
 	int x_talk[4] = {47, 93, 139, 185};
 	int face;
 	int l = 0;
+	Common::Keymapper *keymapper = g_system->getEventManager()->getKeymapper();
 
 	color_abc(kColorRed);
 
 	talkInit(filename);
 
+	keymapper->getKeymap("game-shortcuts")->setEnabled(false);
+	keymapper->getKeymap("animation")->setEnabled(true);
+
 	do {
 		face = _rnd->getRandomNumber(3);
 		copyBackground();
@@ -229,10 +236,13 @@ void DrasculaEngine::talk_drascula_big(int index) {
 
 		pause(3);
 
-		byte key = getScan();
-		if (key == Common::KEYCODE_ESCAPE)
+		Common::CustomEventType action = getAction();
+		if (action == kActionSkip)
 			term_int = 1;
 	} while (!isTalkFinished());
+
+	keymapper->getKeymap("animation")->setEnabled(false);
+	keymapper->getKeymap("game-shortcuts")->setEnabled(true);
 }
 
 void DrasculaEngine::talk_solo(const char *said, const char *filename) {




More information about the Scummvm-git-logs mailing list