diff options
| -rw-r--r-- | engines/sword2/animation.cpp | 2 | ||||
| -rw-r--r-- | engines/sword2/controls.cpp | 11 | ||||
| -rw-r--r-- | engines/sword2/screen.cpp | 3 | ||||
| -rw-r--r-- | engines/sword2/sword2.cpp | 10 | 
4 files changed, 14 insertions, 12 deletions
| diff --git a/engines/sword2/animation.cpp b/engines/sword2/animation.cpp index c3b20d9f57..12998e5e6d 100644 --- a/engines/sword2/animation.cpp +++ b/engines/sword2/animation.cpp @@ -429,7 +429,7 @@ void MoviePlayer::play(SequenceTextInfo *textList, uint32 numLines, int32 leadIn  				terminate = true;  				break;  			case Common::EVENT_KEYDOWN: -				if (event.kbd.keycode == 27) +				if (event.kbd.keycode == Common::KEYCODE_ESCAPE)  					terminate = true;  				break;  			default: diff --git a/engines/sword2/controls.cpp b/engines/sword2/controls.cpp index 277ea108d9..eeb2cda2d9 100644 --- a/engines/sword2/controls.cpp +++ b/engines/sword2/controls.cpp @@ -26,6 +26,7 @@   */  #include "common/stdafx.h" +#include "common/events.h"  #include "common/rect.h"  #include "common/config-manager.h"  #include "common/system.h" @@ -317,9 +318,9 @@ int Dialog::runModal() {  		KeyboardEvent *ke = _vm->keyboardEvent();  		if (ke) { -			if (ke->keycode == 27) +			if (ke->keycode == Common::KEYCODE_ESCAPE)  				setResult(0); -			else if (ke->keycode == '\n' || ke->keycode == '\r') +			else if (ke->keycode == Common::KEYCODE_RETURN || ke->keycode == Common::KEYCODE_KP_ENTER)  				setResult(1);  		} @@ -1130,8 +1131,8 @@ public:  	virtual void onKey(KeyboardEvent *ke) {  		if (_editable) { -			if (ke->keycode == 8) -				_parent->onAction(this, 8); +			if (ke->keycode == Common::KEYCODE_BACKSPACE) +				_parent->onAction(this, Common::KEYCODE_BACKSPACE);  			else if (ke->ascii >= ' ' && ke->ascii <= 255) {  				// Accept the character if the font renderer  				// has what looks like a valid glyph for it. @@ -1354,7 +1355,7 @@ void SaveRestoreDialog::onAction(Widget *widget, int result) {  				drawEditBuffer(slot);  			}  			break; -		case 8: +		case Common::KEYCODE_BACKSPACE:  			if (_editPos > _firstPos) {  				_editBuffer[_editPos - 1] = _editBuffer[_editPos];  				_editBuffer[_editPos--] = 0; diff --git a/engines/sword2/screen.cpp b/engines/sword2/screen.cpp index a31d2a46c9..88850dd3b4 100644 --- a/engines/sword2/screen.cpp +++ b/engines/sword2/screen.cpp @@ -31,6 +31,7 @@  #include "common/stdafx.h"  #include "common/system.h" +#include "common/events.h"  #include "sword2/sword2.h"  #include "sword2/defs.h" @@ -1091,7 +1092,7 @@ void Screen::rollCredits() {  		KeyboardEvent *ke = _vm->keyboardEvent(); -		if (ke && ke->keycode == 27) { +		if (ke && ke->keycode == Common::KEYCODE_ESCAPE) {  			if (!abortCredits) {  				abortCredits = true;  				fadeDown(); diff --git a/engines/sword2/sword2.cpp b/engines/sword2/sword2.cpp index 280beb7c22..22a2fcec45 100644 --- a/engines/sword2/sword2.cpp +++ b/engines/sword2/sword2.cpp @@ -381,17 +381,17 @@ int Sword2Engine::go() {  		KeyboardEvent *ke = keyboardEvent();  		if (ke) { -			if ((ke->modifiers == Common::KBD_CTRL && ke->keycode == 'd') || ke->ascii == '#' || ke->ascii == '~') { +			if ((ke->modifiers == Common::KBD_CTRL && ke->keycode == Common::KEYCODE_d) || ke->ascii == '#' || ke->ascii == '~') {  				_debugger->attach();  			} else if (ke->modifiers == 0 || ke->modifiers == Common::KBD_SHIFT) {  				switch (ke->keycode) { -				case 'p': +				case Common::KEYCODE_p:  					if (_gamePaused)  						unpauseGame();  					else  						pauseGame();  					break; -				case 'c': +				case Common::KEYCODE_c:  					if (!_logic->readVar(DEMO) && !_mouse->isChoosing()) {  						ScreenInfo *screenInfo = _screen->getScreenInfo();  						_logic->fnPlayCredits(NULL); @@ -399,13 +399,13 @@ int Sword2Engine::go() {  					}  					break;  #ifdef SWORD2_DEBUG -				case ' ': +				case Common::KEYCODE_SPACE:  					if (_gamePaused) {  						_stepOneCycle = true;  						unpauseGame();  					}  					break; -				case 's': +				case Common::KEYCODE_s:  					_renderSkip = !_renderSkip;  					break;  #endif | 
