- new function getBXKeyName() returns the name of a BX_KEY symbol

(used by BX_DEBUG message in the keyboard code)
- despription of keymap.cc updated
This commit is contained in:
Volker Ruppert 2003-07-12 08:17:10 +00:00
parent e38fadb2c8
commit e073214525
3 changed files with 13 additions and 7 deletions

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: keymap.cc,v 1.14 2002-10-25 11:44:37 bdenney Exp $
// $Id: keymap.cc,v 1.15 2003-07-12 08:17:10 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -21,13 +21,13 @@
/////////////////////////////////////////////////////////////////////////
//
// Todo
// . Currently supported only by x11. Check if other guis need mapping.
// . Currently supported by sdl, wxGTK and x11. Check if other guis need mapping.
// . Tables look-up should be optimised.
//
#include "bochs.h"
// Table of bocks "BX_KEY_*" symbols
// Table of bochs "BX_KEY_*" symbols
// the table must be in BX_KEY_* order
char *bx_key_symbol[BX_KEY_NBKEYS] = {
"BX_KEY_CTRL_L", "BX_KEY_SHIFT_L", "BX_KEY_F1",
@ -323,3 +323,8 @@ bx_keymap_c::findAsciiChar(Bit8u ch)
return NULL;
}
char *
bx_keymap_c::getBXKeyName(Bit32u key)
{
return bx_key_symbol[key & 0x7fffffff];
}

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: keymap.h,v 1.8 2002-10-25 11:44:37 bdenney Exp $
// $Id: keymap.h,v 1.9 2003-07-12 08:17:10 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -65,6 +65,7 @@ public:
BXKeyEntry *findHostKey(Bit32u hostkeynum);
BXKeyEntry *findAsciiChar(Bit8u ascii);
char *getBXKeyName(Bit32u key);
private:
Bit32u convertStringToBXKey(const char *);

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: keyboard.cc,v 1.78 2003-06-07 18:41:07 vruppert Exp $
// $Id: keyboard.cc,v 1.79 2003-07-12 08:17:10 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -125,7 +125,7 @@ bx_keyb_c::resetinternals(bx_bool powerup)
void
bx_keyb_c::init(void)
{
BX_DEBUG(("Init $Id: keyboard.cc,v 1.78 2003-06-07 18:41:07 vruppert Exp $"));
BX_DEBUG(("Init $Id: keyboard.cc,v 1.79 2003-07-12 08:17:10 vruppert Exp $"));
Bit32u i;
DEV_register_irq(1, "8042 Keyboard controller");
@ -739,7 +739,7 @@ bx_keyb_c::gen_scancode(Bit32u key)
unsigned char *scancode;
Bit8u i;
BX_DEBUG(( "gen_scancode(): BX_KEY %d %s", key & 0x7ffffff, (key & 0x80000000)?"released":"pressed"));
BX_DEBUG(( "gen_scancode(): %s %s", bx_keymap.getBXKeyName(key), (key >> 31)?"released":"pressed"));
if (!BX_KEY_THIS s.kbd_controller.scancodes_translate)
BX_DEBUG(("keyboard: gen_scancode with scancode_translate cleared"));