Reordered the numpad keys so that they make more sense, and simplified the code which returns the values of shifted function keys

svn-id: r41155
This commit is contained in:
Filippos Karapetis 2009-06-04 08:28:20 +00:00
parent 634e023485
commit 70effa46e5
2 changed files with 17 additions and 45 deletions

View File

@ -1326,28 +1326,8 @@ int _gfxop_shiftify(int c) {
}
}
switch (c) {
case SCI_K_F1 :
return SCI_K_SHIFT_F1;
case SCI_K_F2 :
return SCI_K_SHIFT_F2;
case SCI_K_F3 :
return SCI_K_SHIFT_F3;
case SCI_K_F4 :
return SCI_K_SHIFT_F4;
case SCI_K_F5 :
return SCI_K_SHIFT_F5;
case SCI_K_F6 :
return SCI_K_SHIFT_F6;
case SCI_K_F7 :
return SCI_K_SHIFT_F7;
case SCI_K_F8 :
return SCI_K_SHIFT_F8;
case SCI_K_F9 :
return SCI_K_SHIFT_F9;
case SCI_K_F10 :
return SCI_K_SHIFT_F10;
}
if (c >= SCI_K_F1 && c <= SCI_K_F10)
return c + 25;
return c;
}
@ -1488,7 +1468,7 @@ static sci_event_t scummvm_get_event(gfx_driver_t *drv) {
// SCI_K_SHIFT_F1 == 84 << 8
input.data = SCI_K_F1 + ((input.data - Common::KEYCODE_F1)<<8);
if (input.buckybits & (SCI_EVM_LSHIFT | SCI_EVM_RSHIFT))
input.character = input.data + SCI_K_SHIFT_F1 - SCI_K_F1;
input.character = input.data + 25;
else
input.character = input.data;
} else {

View File

@ -72,17 +72,20 @@ struct sci_event_t {
#define SCI_K_TAB '\t'
#define SCI_K_SHIFT_TAB (0xf << 8)
#define SCI_K_END (79 << 8)
#define SCI_K_DOWN (80 << 8)
#define SCI_K_PGDOWN (81 << 8)
#define SCI_K_LEFT (75 << 8)
#define SCI_K_CENTER (76 << 8)
#define SCI_K_RIGHT (77 << 8)
#define SCI_K_HOME (71 << 8)
#define SCI_K_UP (72 << 8)
#define SCI_K_PGUP (73 << 8)
#define SCI_K_INSERT (82 << 8)
#define SCI_K_DELETE (83 << 8)
#define SCI_K_HOME (71 << 8) // 7
#define SCI_K_UP (72 << 8) // 8
#define SCI_K_PGUP (73 << 8) // 9
//
#define SCI_K_LEFT (75 << 8) // 4
#define SCI_K_CENTER (76 << 8) // 5
#define SCI_K_RIGHT (77 << 8) // 6
//
#define SCI_K_END (79 << 8) // 1
#define SCI_K_DOWN (80 << 8) // 2
#define SCI_K_PGDOWN (81 << 8) // 3
//
#define SCI_K_INSERT (82 << 8) // 0
#define SCI_K_DELETE (83 << 8) // .
#define SCI_K_F1 (59<<8)
#define SCI_K_F2 (60<<8)
@ -95,17 +98,6 @@ struct sci_event_t {
#define SCI_K_F9 (67<<8)
#define SCI_K_F10 (68<<8)
#define SCI_K_SHIFT_F1 (84<<8)
#define SCI_K_SHIFT_F2 (85<<8)
#define SCI_K_SHIFT_F3 (86<<8)
#define SCI_K_SHIFT_F4 (87<<8)
#define SCI_K_SHIFT_F5 (88<<8)
#define SCI_K_SHIFT_F6 (89<<8)
#define SCI_K_SHIFT_F7 (90<<8)
#define SCI_K_SHIFT_F8 (91<<8)
#define SCI_K_SHIFT_F9 (92<<8)
#define SCI_K_SHIFT_F10 (93<<8)
/*Values for buckybits */
#define SCI_EVM_RSHIFT (1<<0)
#define SCI_EVM_LSHIFT (1<<1)