aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/gfx
diff options
context:
space:
mode:
authorFilippos Karapetis2009-02-24 22:58:44 +0000
committerFilippos Karapetis2009-02-24 22:58:44 +0000
commit5618a81cff5f9f171764ec2b350944eabd0ec5dd (patch)
tree43f85d3b4498c115eb08ed39474af41afb2a09ed /engines/sci/gfx
parent936e807ef3094af4f22c71649832762036af841d (diff)
downloadscummvm-rg350-5618a81cff5f9f171764ec2b350944eabd0ec5dd.tar.gz
scummvm-rg350-5618a81cff5f9f171764ec2b350944eabd0ec5dd.tar.bz2
scummvm-rg350-5618a81cff5f9f171764ec2b350944eabd0ec5dd.zip
Replaced some of the internal SCI scan codes with the ones from ScummVM
svn-id: r38870
Diffstat (limited to 'engines/sci/gfx')
-rw-r--r--engines/sci/gfx/gfx_driver.cpp24
-rw-r--r--engines/sci/gfx/operations.cpp23
2 files changed, 15 insertions, 32 deletions
diff --git a/engines/sci/gfx/gfx_driver.cpp b/engines/sci/gfx/gfx_driver.cpp
index 2967d83525..d388e869cc 100644
--- a/engines/sci/gfx/gfx_driver.cpp
+++ b/engines/sci/gfx/gfx_driver.cpp
@@ -382,11 +382,11 @@ static sci_event_t scummvm_get_event(gfx_driver_t *drv) {
if (input.data == Common::KEYCODE_TAB) {
// Tab
input.type = SCI_EVT_KEYBOARD;
- input.data = SCI_K_TAB;
+ input.data = Common::KEYCODE_TAB;
if (input.buckybits & (SCI_EVM_LSHIFT | SCI_EVM_RSHIFT))
input.character = SCI_K_SHIFT_TAB;
else
- input.character = SCI_K_TAB;
+ input.character = Common::KEYCODE_TAB;
}
} else if ((input.data >= Common::KEYCODE_F1) && input.data <= Common::KEYCODE_F10) {
// F1-F10
@@ -403,34 +403,16 @@ static sci_event_t scummvm_get_event(gfx_driver_t *drv) {
input.type = SCI_EVT_KEYBOARD;
switch (ev.kbd.keycode) {
case Common::KEYCODE_UP:
- input.data = SCI_K_UP;
- break;
case Common::KEYCODE_DOWN:
- input.data = SCI_K_DOWN;
- break;
case Common::KEYCODE_RIGHT:
- input.data = SCI_K_RIGHT;
- break;
case Common::KEYCODE_LEFT:
- input.data = SCI_K_LEFT;
- break;
case Common::KEYCODE_INSERT:
- input.data = SCI_K_INSERT;
- break;
case Common::KEYCODE_HOME:
- input.data = SCI_K_HOME;
- break;
case Common::KEYCODE_END:
- input.data = SCI_K_END;
- break;
case Common::KEYCODE_PAGEUP:
- input.data = SCI_K_PGUP;
- break;
case Common::KEYCODE_PAGEDOWN:
- input.data = SCI_K_PGDOWN;
- break;
case Common::KEYCODE_DELETE:
- input.data = SCI_K_DELETE;
+ input.data = ev.kbd.keycode;
break;
//TODO: SCI_K_CENTER
default:
diff --git a/engines/sci/gfx/operations.cpp b/engines/sci/gfx/operations.cpp
index f29aeb395c..e02b5ffed0 100644
--- a/engines/sci/gfx/operations.cpp
+++ b/engines/sci/gfx/operations.cpp
@@ -29,6 +29,7 @@
#include "sci/gfx/operations.h"
#include "common/system.h"
+#include "common/keyboard.h"
namespace Sci {
@@ -1529,7 +1530,7 @@ int _gfxop_shiftify(int c) {
return shifted_numbers[c-'0'];
switch (c) {
- case SCI_K_TAB:
+ case Common::KEYCODE_TAB:
return SCI_K_SHIFT_TAB;
case ']':
return '}';
@@ -1586,27 +1587,27 @@ int _gfxop_shiftify(int c) {
static int _gfxop_numlockify(int c) {
switch (c) {
- case SCI_K_DELETE:
+ case Common::KEYCODE_DELETE:
return '.';
- case SCI_K_INSERT:
+ case Common::KEYCODE_INSERT:
return '0';
- case SCI_K_END:
+ case Common::KEYCODE_END:
return '1';
- case SCI_K_DOWN:
+ case Common::KEYCODE_DOWN:
return '2';
- case SCI_K_PGDOWN:
+ case Common::KEYCODE_PAGEDOWN:
return '3';
- case SCI_K_LEFT:
+ case Common::KEYCODE_LEFT:
return '4';
case SCI_K_CENTER:
return '5';
- case SCI_K_RIGHT:
+ case Common::KEYCODE_RIGHT:
return '6';
- case SCI_K_HOME:
+ case Common::KEYCODE_HOME:
return '7';
- case SCI_K_UP:
+ case Common::KEYCODE_UP:
return '8';
- case SCI_K_PGUP:
+ case Common::KEYCODE_PAGEUP:
return '9';
default:
return c; // Unchanged