[Scummvm-git-logs] scummvm master -> 81909e6dabffe56949ff410c4c387aea4b71934a

a-yyg 76591232+a-yyg at users.noreply.github.com
Fri Aug 13 13:41:42 UTC 2021


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:
81909e6dab SAGA2: Replace remaining SpecialKey uses by Common::KeyCode


Commit: 81909e6dabffe56949ff410c4c387aea4b71934a
    https://github.com/scummvm/scummvm/commit/81909e6dabffe56949ff410c4c387aea4b71934a
Author: a/ (yuri.kgpps at gmail.com)
Date: 2021-08-13T22:41:02+09:00

Commit Message:
SAGA2: Replace remaining SpecialKey uses by Common::KeyCode

Changed paths:
    engines/saga2/automap.cpp
    engines/saga2/document.cpp
    engines/saga2/gtextbox.cpp


diff --git a/engines/saga2/automap.cpp b/engines/saga2/automap.cpp
index 734d895b51..06686c1eaf 100644
--- a/engines/saga2/automap.cpp
+++ b/engines/saga2/automap.cpp
@@ -24,6 +24,8 @@
  *   (c) 1993-1996 The Wyrmkeep Entertainment Co.
  */
 
+#include "common/keyboard.h"
+
 #include "saga2/saga2.h"
 #include "saga2/automap.h"
 #include "saga2/blitters.h"
@@ -253,24 +255,22 @@ bool CAutoMap::activate(gEventType why) {
 	return false;
 }
 
-#define SpecialKey(k) ((k>>8)+0x80)
-
 bool CAutoMap::keyStroke(gPanelMessage &msg) {
 	gEvent ev;
 	switch (msg.key) {
-	case 0x1B:
+		case Common::ASCII_ESCAPE:
 		cmdAutoMapEsc(ev);
 		return true;
-	case SpecialKey(homeKey):
+	case Common::KEYCODE_HOME:
 		cmdAutoMapHome(ev);
 		return true;
-	case SpecialKey(endKey):
+	case Common::KEYCODE_END:
 		cmdAutoMapEnd(ev);
 		return true;
-	case SpecialKey(pageUpKey):
+	case Common::KEYCODE_PAGEUP:
 		cmdAutoMapPgUp(ev);
 		return true;
-	case SpecialKey(pageDownKey):
+	case Common::KEYCODE_PAGEDOWN:
 		cmdAutoMapPgDn(ev);
 		return true;
 	default:
@@ -282,11 +282,11 @@ bool CAutoMap::keyStroke(gPanelMessage &msg) {
 
 gPanel *CAutoMap::keyTest(int16 key) {
 	switch (key) {
-	case 0x1B:
-	case SpecialKey(homeKey):
-	case SpecialKey(endKey):
-	case SpecialKey(pageUpKey):
-	case SpecialKey(pageDownKey):
+	case Common::ASCII_ESCAPE:
+	case Common::KEYCODE_HOME:
+	case Common::KEYCODE_END:
+	case Common::KEYCODE_PAGEUP:
+	case Common::KEYCODE_PAGEDOWN:
 		return this;
 	default:
 		return NULL;
diff --git a/engines/saga2/document.cpp b/engines/saga2/document.cpp
index de9631e5a7..e88b6ece3f 100644
--- a/engines/saga2/document.cpp
+++ b/engines/saga2/document.cpp
@@ -24,6 +24,8 @@
  *   (c) 1993-1996 The Wyrmkeep Entertainment Co.
  */
 
+#include "common/keyboard.h"
+
 #include "saga2/saga2.h"
 #include "saga2/document.h"
 #include "saga2/script.h"
@@ -235,25 +237,22 @@ bool CDocument::activate(gEventType why) {
 	return false;
 }
 
-#define SpecialKey(k) ((k>>8)+0x80)
-
-
 bool CDocument::keyStroke(gPanelMessage &msg) {
 	gEvent ev;
 	switch (msg.key) {
-	case 0x1B:
+	case Common::ASCII_ESCAPE:
 		cmdDocumentEsc(ev);
 		return true;
-	case SpecialKey(leftArrowKey):
+	case Common::KEYCODE_LEFT:
 		cmdDocumentLt(ev);
 		return true;
-	case SpecialKey(rightArrowKey):
+	case Common::KEYCODE_RIGHT:
 		cmdDocumentRt(ev);
 		return true;
-	case SpecialKey(upArrowKey):
+	case Common::KEYCODE_UP:
 		cmdDocumentUp(ev);
 		return true;
-	case SpecialKey(downArrowKey):
+	case Common::KEYCODE_DOWN:
 		cmdDocumentDn(ev);
 		return true;
 	default:
@@ -265,11 +264,11 @@ bool CDocument::keyStroke(gPanelMessage &msg) {
 
 gPanel *CDocument::keyTest(int16 key) {
 	switch (key) {
-	case 0x1B:
-	case SpecialKey(leftArrowKey):
-	case SpecialKey(rightArrowKey):
-	case SpecialKey(upArrowKey):
-	case SpecialKey(downArrowKey):
+	case Common::ASCII_ESCAPE:
+	case Common::KEYCODE_LEFT:
+	case Common::KEYCODE_RIGHT:
+	case Common::KEYCODE_UP:
+	case Common::KEYCODE_DOWN:
 		return this;
 	default:
 		return NULL;
diff --git a/engines/saga2/gtextbox.cpp b/engines/saga2/gtextbox.cpp
index 119200d948..e098d42a4f 100644
--- a/engines/saga2/gtextbox.cpp
+++ b/engines/saga2/gtextbox.cpp
@@ -48,8 +48,6 @@ extern gFont        *mainFont;
 //-----------------------------------------------------------------------
 // init
 
-#define SpecialKey(k) ((k>>8)+0x80)
-
 /****** gtextbox.cpp/gTextBox [class] ******************************
 *
 *   NAME




More information about the Scummvm-git-logs mailing list