- New keymap architecture.

The localisation is now read from keymap files
  The keymap files are in gui/keymaps directory
This commit is contained in:
Christophe Bothamy 2002-03-06 09:31:55 +00:00
parent 1c0a1360bf
commit e931247144
9 changed files with 980 additions and 727 deletions

View File

@ -328,11 +328,10 @@ i440fxsupport: enabled=0
# KEYBOARD_MAPPING: # KEYBOARD_MAPPING:
# This enables a remap of a physical localized keyboard to a # This enables a remap of a physical localized keyboard to a
# virtualized us keyboard, as the PC architecture expects. # virtualized us keyboard, as the PC architecture expects.
# If enabled, the keymap must be specified and should be # If enabled, the keymap file must be specified.
# one of "us", "fr", "de", or "es". More tables will be implemented.
# #
# Examples: # Examples:
# keyboard_mapping: enabled=1, map=de # keyboard_mapping: enabled=1, map=gui/keymaps/x11-pc-de.map
#======================================================================= #=======================================================================
keyboard_mapping: enabled=0, map= keyboard_mapping: enabled=0, map=
@ -348,7 +347,6 @@ keyboard_mapping: enabled=0, map=
#======================================================================= #=======================================================================
#keyboard_type: mf #keyboard_type: mf
#======================================================================= #=======================================================================
# for Macintosh, use the style of pathnames in the following # for Macintosh, use the style of pathnames in the following
# examples. # examples.

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// $Id: keymap.cc,v 1.1 2001-12-14 17:54:58 cbothamy Exp $ // $Id: keymap.cc,v 1.2 2002-03-06 09:31:55 cbothamy Exp $
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// //
// Copyright (C) 2001 Christophe Bothamy // Copyright (C) 2001 Christophe Bothamy
@ -21,15 +21,58 @@
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// //
// Todo // Todo
// . Check if other guis need mapping. // . Currently supported only by x11. Check if other guis need mapping.
// . Tables look-up should be optimised. // . Tables look-up should be optimised.
// . For now up to 10 different map can be uploaded to the object
// The table size should be increased/dynamic.
// //
#include "bochs.h" #include "bochs.h"
// Table of bocks "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",
"BX_KEY_F2", "BX_KEY_F3", "BX_KEY_F4",
"BX_KEY_F5", "BX_KEY_F6", "BX_KEY_F7",
"BX_KEY_F8", "BX_KEY_F9", "BX_KEY_F10",
"BX_KEY_F11", "BX_KEY_F12", "BX_KEY_CTRL_R",
"BX_KEY_SHIFT_R", "BX_KEY_CAPS_LOCK", "BX_KEY_NUM_LOCK",
"BX_KEY_ALT_L", "BX_KEY_ALT_R", "BX_KEY_A",
"BX_KEY_B", "BX_KEY_C", "BX_KEY_D",
"BX_KEY_E", "BX_KEY_F", "BX_KEY_G",
"BX_KEY_H", "BX_KEY_I", "BX_KEY_J",
"BX_KEY_K", "BX_KEY_L", "BX_KEY_M",
"BX_KEY_N", "BX_KEY_O", "BX_KEY_P",
"BX_KEY_Q", "BX_KEY_R", "BX_KEY_S",
"BX_KEY_T", "BX_KEY_U", "BX_KEY_V",
"BX_KEY_W", "BX_KEY_X", "BX_KEY_Y",
"BX_KEY_Z", "BX_KEY_0", "BX_KEY_1",
"BX_KEY_2", "BX_KEY_3", "BX_KEY_4",
"BX_KEY_5", "BX_KEY_6", "BX_KEY_7",
"BX_KEY_8", "BX_KEY_9", "BX_KEY_ESC",
"BX_KEY_SPACE", "BX_KEY_SINGLE_QUOTE", "BX_KEY_COMMA",
"BX_KEY_PERIOD", "BX_KEY_SLASH", "BX_KEY_SEMICOLON",
"BX_KEY_EQUALS", "BX_KEY_LEFT_BRACKET", "BX_KEY_BACKSLASH",
"BX_KEY_RIGHT_BRACKET", "BX_KEY_MINUS", "BX_KEY_GRAVE",
"BX_KEY_BACKSPACE", "BX_KEY_ENTER", "BX_KEY_TAB",
"BX_KEY_LEFT_BACKSLASH", "BX_KEY_PRINT", "BX_KEY_SCRL_LOCK",
"BX_KEY_PAUSE", "BX_KEY_INSERT", "BX_KEY_DELETE",
"BX_KEY_HOME", "BX_KEY_END", "BX_KEY_PAGE_UP",
"BX_KEY_PAGE_DOWN", "BX_KEY_KP_ADD", "BX_KEY_KP_SUBTRACT",
"BX_KEY_KP_END", "BX_KEY_KP_DOWN", "BX_KEY_KP_PAGE_DOWN",
"BX_KEY_KP_LEFT", "BX_KEY_KP_RIGHT", "BX_KEY_KP_HOME",
"BX_KEY_KP_UP", "BX_KEY_KP_PAGE_UP", "BX_KEY_KP_INSERT",
"BX_KEY_KP_DELETE", "BX_KEY_KP_5", "BX_KEY_UP",
"BX_KEY_DOWN", "BX_KEY_LEFT", "BX_KEY_RIGHT",
"BX_KEY_KP_ENTER", "BX_KEY_KP_MULTIPLY", "BX_KEY_KP_DIVIDE",
"BX_KEY_PRINT_SCREEN", "BX_KEY_SCROLL_LOCK", "BX_KEY_WIN_L",
"BX_KEY_WIN_R", "BX_KEY_MENU", "BX_KEY_ALT_SYSREQ",
"BX_KEY_CTRL_BREAK", "BX_KEY_INT_BACK", "BX_KEY_INT_FORWARD",
"BX_KEY_INT_STOP", "BX_KEY_INT_MAIL", "BX_KEY_INT_SEARCH",
"BX_KEY_INT_FAV", "BX_KEY_INT_HOME", "BX_KEY_POWER_MYCOMP",
"BX_KEY_POWER_CALC", "BX_KEY_POWER_SLEEP", "BX_KEY_POWER_POWER",
"BX_KEY_POWER_WAKE",
};
bx_keymap_c bx_keymap; bx_keymap_c bx_keymap;
#define LOG_THIS bx_keymap. #define LOG_THIS bx_keymap.
@ -37,117 +80,150 @@ bx_keymap_c bx_keymap;
bx_keymap_c::bx_keymap_c(void) bx_keymap_c::bx_keymap_c(void)
{ {
put("KMAP"); put("KMAP");
nbKeymaps=0;
defaultKeymap=BX_KEYMAP_MAX_TABLES; keymapCount = 0;
keymapTable = (KeyEntry *)NULL;
} }
bx_keymap_c::~bx_keymap_c(void) bx_keymap_c::~bx_keymap_c(void)
{ {
if(keymapTable != NULL) {
free(keymapTable);
keymapTable = (KeyEntry *)NULL;
}
keymapCount = 0;
} }
void void
bx_keymap_c::addTable(const char *mapName, const void *keymap, Bit32u size) bx_keymap_c::loadKeymap(Bit32u stringToSymbol(const char*))
{ {
if(nbKeymaps<BX_KEYMAP_MAX_TABLES) { if(bx_options.keyboard.OuseMapping->get()) {
keymaps[nbKeymaps]=keymap; loadKeymap(stringToSymbol,bx_options.keyboard.Okeymap->getptr());
mapNames[nbKeymaps]=mapName;
mapSizes[nbKeymaps]=size;
BX_INFO(("Added keymap '%s' at position %d (%d entries)",mapName,nbKeymaps,size));
nbKeymaps++;
}
else {
BX_PANIC(("No space to add keymap '%s'",mapName));
} }
} }
void void
bx_keymap_c::setDefault(const char *mapName) bx_keymap_c::loadKeymap(Bit32u stringToSymbol(const char*), const char* filename)
{ {
Bit32u i; FILE *keymapFile;
char line[256], c, *p, *bxSymbol, *guiSymbol;
Bit32u bxKey, guiKey;
Bit16u lineCount=0;
for(i=0;i<nbKeymaps;i++){ if((keymapFile = fopen(filename,"r"))==NULL) {
if(strcmp(mapName,mapNames[i])==0){ BX_PANIC(("Can not open keymap file '%s'.",filename));
defaultKeymap=i; }
BX_INFO(("Default keymap set to '%s'",mapNames[i]));
return; BX_INFO(("Loading keymap from '%s'",filename));
// Read keymap file one line at a time
while(1) {
fgets(line, sizeof(line)-1, keymapFile);
lineCount++;
// End of file
if(feof(keymapFile)) break;
// silently drop till end of line
if( (p=strchr(line,'\n')) == NULL) {
do {
c = fgetc(keymapFile);
} while((c!='\n')&&(c!=0));
} }
} else {
BX_ERROR(("Unknown keymap %s",mapName)); *p = 0;
}
void*
bx_keymap_c::getTable(char *mapName)
{
Bit32u i;
for(i=0;i<nbKeymaps;i++){
if(strcmp(mapName,mapNames[i])==0){
return(&keymaps[i]);
} }
}
BX_ERROR(("Unknown keymap %s",mapName));
}
void* // drop comments
bx_keymap_c::getTable(void) p = strchr(line,'#');
{ if (p!=NULL) *p = 0;
char* localKeymap;
localKeymap=bx_options.keyboard.Okeymap->getptr(); // If string is empty
return(getTable(localKeymap)); p = line; while (*p!=0 && *p==' ') p++;
if (*p==0) continue;
// Parse line, find '=', split line
p = strchr(line,'=');
if (p==NULL) {
BX_INFO(("line %d: Unknown format",lineCount));
continue;
}
else {
*p = 0;
guiSymbol = p+1;
}
// Find first and last char of gui key symbol
while (*guiSymbol==' ') guiSymbol++;
p=guiSymbol; while (*p!=0 && *p!=' ') p++; *p=0;
// Find first and last char of BX_KEY
bxSymbol=line; while (*bxSymbol==' ') bxSymbol++;
p=bxSymbol; while (*p!=0 && *p!=' ') p++; *p=0;
// Here we have the two symbols
bxKey = convertStringToBXKey(bxSymbol);
guiKey = stringToSymbol(guiSymbol);
// Check if data is valid
if( bxKey==BX_KEYMAP_UNKNOWN ) {
BX_INFO(("line %d: Ignoring unknown BX_KEY constant '%s'",lineCount,bxSymbol));
continue;
}
if( guiKey==BX_KEYMAP_UNKNOWN ) {
BX_INFO(("line %d: Ignoring unknown GUI constant '%s'",lineCount,guiSymbol));
continue;
}
keymapTable=(KeyEntry*)realloc(keymapTable,(keymapCount+1) * sizeof(KeyEntry));
if(keymapTable==NULL)
BX_PANIC(("Can not allocate memory for keymap table."));
keymapTable[keymapCount].bxKey=bxKey;
keymapTable[keymapCount].guiKey=guiKey;
keymapCount++;
}
BX_INFO(("Loaded %d symbols",keymapCount));
fclose(keymapFile);
} }
Bit32u Bit32u
bx_keymap_c::getBXKey(char* mapName, Bit32u key) bx_keymap_c::convertStringToBXKey(const char* string)
{ {
Bit32u i,mapIndex; Bit16u i;
Bit32u *keymap,size;
// First we browse through the specific keymap // We look through the bx_key_symbol table to find the searched string
mapIndex=BX_KEYMAP_MAX_TABLES; for (i=0; i<BX_KEY_NBKEYS; i++) {
for(i=0; i<nbKeymaps; i++){ if (strcmp(string,bx_key_symbol[i])==0) {
if(strcmp(mapName,mapNames[i])==0){ return i;
mapIndex=i;
break;
}
}
if(mapIndex<BX_KEYMAP_MAX_TABLES){
keymap=(Bit32u*)(keymaps[mapIndex]);
size=mapSizes[mapIndex];
for(i=0; i<size; i++){
if(keymap[i*2]==key)
return(keymap[i*2+1]);
} }
} }
else BX_ERROR(("Unknown keymap %s",mapName));
// Then, if not found, search into the default keymap // Key is not known
if((defaultKeymap<BX_KEYMAP_MAX_TABLES) return BX_KEYMAP_UNKNOWN;
&&(defaultKeymap!=mapIndex)){ }
keymap=(Bit32u*)keymaps[defaultKeymap];
size=mapSizes[defaultKeymap]; #include <X11/Xlib.h>
for(i=0;i <size; i++){
if(keymap[i*2]==key) Bit32u
return(keymap[i*2+1]); bx_keymap_c::getBXKey(Bit32u key)
{
Bit16u i;
// We look through the keymap table to find the searched key
for (i=0; i<keymapCount; i++) {
if (keymapTable[i].guiKey == key) {
return keymapTable[i].bxKey;
} }
} }
// Return default // Return default
return BX_KEY_UNHANDLED; return BX_KEY_UNHANDLED;
} }
Bit32u
bx_keymap_c::getBXKey(Bit32u key)
{
Bit32u i,mapIndex;
Bit32u *keymap,size;
char* localKeymap;
localKeymap=bx_options.keyboard.Okeymap->getptr();
return(getBXKey(localKeymap,key));
}

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// $Id: keymap.h,v 1.1 2001-12-14 17:54:58 cbothamy Exp $ // $Id: keymap.h,v 1.2 2002-03-06 09:31:55 cbothamy Exp $
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// //
// Copyright (C) 2001 Christophe Bothamy // Copyright (C) 2001 Christophe Bothamy
@ -21,79 +21,44 @@
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// //
// Methods of bx_keymap_c : // Methods of bx_keymap_c :
// - void addTable(const char *mapName, const void *table, Bit32u size);
// Adds the table named "mapName" to the keymap list
// Size should be the number of entries in the
// //
// - void setDefault(const char *mapName); // - loadKeymap(Bit32u convertStringToSymbol(const char*));
// Sets the default keymap // loads the configuration specified keymap file if keymapping is enabled
// using convertStringToSymbol to convert strings to client constants
// //
// - void* getTable(char *mapName); // - loadKeymap(Bit32u convertStringToSymbol(const char*), const char* filename);
// Returns the table named "mapName" // loads the specified keymap file
// using convertStringToSymbol to convert strings to client constants
// //
// - void* getTable(void); // - convertStringToBXKey
// Returns the table specified in the conf file // convert a string to a BX_KEY code
// //
// - Bit32u getBXKey(char *mapName, Bit32u key);
// Returns the BX_KEY for the key and the table "mapName"
//
// - Bit32u getBXKey(Bit32u key);
// Returns the BX_KEY for the key and the table specified in
// the conf file.
//
// Format of the table
// - if the GUI provide its own translation function, the format
// of the keymap table is free and the number of elements
// should be set to 0. This GUI should also use the getTable
// functions.
// - if the GUI wants the keymap object do the translation to
// BX_KEYs then the format of the table is Bit32u table[N][2].
// Each entry should contain the physical constant and the
// associated BX_KEY
//
// Table writing
// Each GUI should provide at least one table, the standard 'us'
// keyboard one. Then they should provide additional table for
// each country specific keyboard, as a diff to the standard one.
//
// Just look at each key of the US Keyboard, and write down
// what you see on your real keyboard
// This gives you the XK_* symbol (your keyboard)
// and the BX_KEY_* symbol (US keyboard)
//
// You may have to add your country specific X11 keysyms
// and don't forget to add a line for every symbol you can type
// on each key
//
// The US PC Keyboard looks like this (can somebody confirm ?)
//
// Top Row Esc F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12
// 2nd row ` 1 2 3 4 5 6 7 8 9 0 - = \ Back
// 3rd row Tab Q W E R T Y U I O P [ ] Enter
// 4rd row Caps A S D F G H J K L ; '
// 5rd row lShift l\ Z X C V B N M , . / rShift
// 6rd row lCtrl lAlt Space rAlt rCtrl
#define BX_KEYMAP_MAX_TABLES 10 // In case of unknown symbol
#define BX_KEYMAP_UNKNOWN 0xFFFFFFFF
// Structure of an element of the keymap table
typedef struct {
Bit32u bxKey;
Bit32u guiKey;
} KeyEntry;
class bx_keymap_c : public logfunctions { class bx_keymap_c : public logfunctions {
public: public:
bx_keymap_c(void); bx_keymap_c(void);
~bx_keymap_c(void); ~bx_keymap_c(void);
void addTable(const char *mapName, const void *table, Bit32u size); void loadKeymap(Bit32u(*)(const char*));
void setDefault(const char *mapName); void loadKeymap(Bit32u(*)(const char*),const char *filename);
void* getTable(char *mapName);
void* getTable(void);
Bit32u getBXKey(char *mapName, Bit32u key);
Bit32u getBXKey(Bit32u key); Bit32u getBXKey(Bit32u key);
private: private:
const char* mapNames[BX_KEYMAP_MAX_TABLES]; Bit32u convertStringToBXKey(const char *);
const void* keymaps[BX_KEYMAP_MAX_TABLES];
Bit32u mapSizes[BX_KEYMAP_MAX_TABLES]; KeyEntry *keymapTable;
Bit32u defaultKeymap; Bit16u keymapCount;
Bit32u nbKeymaps; };
};
extern bx_keymap_c bx_keymap; extern bx_keymap_c bx_keymap;

View File

@ -0,0 +1,216 @@
# Bochs Keymap file : X11 - i386 - German
# Author : Volker Ruppert
#
# Format :
# BX_KEY_* (bochs symbol) = X11 key symbol (without XK_ prefix)
#
BX_KEY_0 = 0
BX_KEY_0 = braceright
BX_KEY_0 = equal
BX_KEY_1 = 1
BX_KEY_1 = exclam
BX_KEY_1 = onesuperior
BX_KEY_2 = 2
BX_KEY_2 = quotedbl
BX_KEY_2 = twosuperior
BX_KEY_3 = 3
BX_KEY_3 = section
BX_KEY_3 = threesuperior
BX_KEY_4 = 4
BX_KEY_4 = dollar
BX_KEY_4 = onequarter
BX_KEY_5 = 5
BX_KEY_5 = onehalf
BX_KEY_5 = percent
BX_KEY_6 = 6
BX_KEY_6 = ampersand
BX_KEY_6 = threequarters
BX_KEY_7 = 7
BX_KEY_7 = braceleft
BX_KEY_7 = slash
BX_KEY_8 = 8
BX_KEY_8 = bracketleft
BX_KEY_8 = parenleft
BX_KEY_9 = 9
BX_KEY_9 = bracketright
BX_KEY_9 = parenright
BX_KEY_A = A
BX_KEY_A = a
BX_KEY_A = ae
BX_KEY_B = B
BX_KEY_B = b
BX_KEY_B = rightdoublequotemark
BX_KEY_C = C
BX_KEY_C = c
BX_KEY_C = cent
BX_KEY_D = D
BX_KEY_D = d
BX_KEY_D = eth
BX_KEY_E = E
BX_KEY_E = EuroSign
BX_KEY_E = e
BX_KEY_F = F
BX_KEY_F = dstroke
BX_KEY_F = f
BX_KEY_G = G
BX_KEY_G = eng
BX_KEY_G = g
BX_KEY_H = H
BX_KEY_H = h
BX_KEY_H = hstroke
BX_KEY_I = I
BX_KEY_I = i
BX_KEY_I = rightarrow
BX_KEY_J = J
BX_KEY_J = j
BX_KEY_K = K
BX_KEY_K = k
BX_KEY_K = kra
BX_KEY_L = L
BX_KEY_L = l
BX_KEY_M = M
BX_KEY_M = m
BX_KEY_M = mu
BX_KEY_N = N
BX_KEY_N = n
BX_KEY_O = O
BX_KEY_O = o
BX_KEY_O = oslash
BX_KEY_P = P
BX_KEY_P = p
BX_KEY_P = thorn
BX_KEY_Q = Q
BX_KEY_Q = at
BX_KEY_Q = q
BX_KEY_R = R
BX_KEY_R = paragraph
BX_KEY_R = r
BX_KEY_S = S
BX_KEY_S = s
BX_KEY_T = T
BX_KEY_T = t
BX_KEY_T = tslash
BX_KEY_U = U
BX_KEY_U = downarrow
BX_KEY_U = u
BX_KEY_V = V
BX_KEY_V = leftdoublequotemark
BX_KEY_V = v
BX_KEY_W = W
BX_KEY_W = lstroke
BX_KEY_W = w
BX_KEY_X = X
BX_KEY_X = guillemotright
BX_KEY_X = x
BX_KEY_Y = Z
BX_KEY_Y = leftarrow
BX_KEY_Y = z
BX_KEY_Z = Y
BX_KEY_Z = guillemotleft
BX_KEY_Z = y
BX_KEY_F1 = F1
BX_KEY_F2 = F2
BX_KEY_F3 = F3
BX_KEY_F4 = F4
BX_KEY_F5 = F5
BX_KEY_F6 = F6
BX_KEY_F7 = F7
BX_KEY_F8 = F8
BX_KEY_F9 = F9
BX_KEY_F10 = F10
BX_KEY_F11 = F11
BX_KEY_F12 = F12
BX_KEY_ALT_L = Alt_L
BX_KEY_ALT_L = Meta_L
BX_KEY_ALT_R = Mode_switch
BX_KEY_ALT_R = Multi_key
BX_KEY_BACKSLASH = apostrophe
BX_KEY_BACKSLASH = numbersign
BX_KEY_BACKSPACE = BackSpace
BX_KEY_CAPS_LOCK = Caps_Lock
BX_KEY_COMMA = comma
BX_KEY_COMMA = horizconnector
BX_KEY_COMMA = semicolon
BX_KEY_CTRL_L = Control_L
BX_KEY_CTRL_R = Control_R
BX_KEY_DELETE = Delete
BX_KEY_DOWN = Down
BX_KEY_END = End
BX_KEY_ENTER = Return
BX_KEY_EQUALS = acute
BX_KEY_EQUALS = cedilla
BX_KEY_EQUALS = grave
BX_KEY_ESC = Escape
BX_KEY_GRAVE = asciicircum
BX_KEY_GRAVE = degree
BX_KEY_GRAVE = notsign
BX_KEY_HOME = Home
BX_KEY_INSERT = Insert
BX_KEY_KP_5 = KP_5
BX_KEY_KP_5 = KP_Begin
BX_KEY_KP_ADD = KP_Add
BX_KEY_KP_DELETE = KP_Decimal
BX_KEY_KP_DELETE = KP_Delete
BX_KEY_KP_DIVIDE = KP_Divide
BX_KEY_KP_DOWN = KP_2
BX_KEY_KP_DOWN = KP_Down
BX_KEY_KP_END = KP_1
BX_KEY_KP_END = KP_End
BX_KEY_KP_ENTER = KP_Enter
BX_KEY_KP_HOME = KP_7
BX_KEY_KP_HOME = KP_Home
BX_KEY_KP_INSERT = KP_0
BX_KEY_KP_INSERT = KP_Insert
BX_KEY_KP_LEFT = KP_4
BX_KEY_KP_LEFT = KP_Left
BX_KEY_KP_MULTIPLY = KP_Multiply
BX_KEY_KP_PAGE_DOWN = KP_3
BX_KEY_KP_PAGE_DOWN = KP_Page_Down
BX_KEY_KP_PAGE_UP = KP_9
BX_KEY_KP_PAGE_UP = KP_Page_Up
BX_KEY_KP_RIGHT = KP_6
BX_KEY_KP_RIGHT = KP_Right
BX_KEY_KP_SUBTRACT = KP_Subtract
BX_KEY_KP_UP = KP_8
BX_KEY_KP_UP = KP_Up
BX_KEY_LEFT = Left
BX_KEY_LEFT_BACKSLASH = bar
BX_KEY_LEFT_BACKSLASH = greater
BX_KEY_LEFT_BACKSLASH = less
BX_KEY_LEFT_BRACKET = Udiaeresis
BX_KEY_LEFT_BRACKET = diaeresis
BX_KEY_LEFT_BRACKET = udiaeresis
BX_KEY_MENU = Menu
BX_KEY_MINUS = backslash
BX_KEY_MINUS = question
BX_KEY_MINUS = ssharp
BX_KEY_NUM_LOCK = Num_Lock
BX_KEY_PAGE_DOWN = Page_Down
BX_KEY_PAGE_UP = Page_Up
BX_KEY_PAUSE = Break
BX_KEY_PAUSE = Pause
BX_KEY_PERIOD = colon
BX_KEY_PERIOD = period
BX_KEY_PERIOD = periodcentered
BX_KEY_PRINT = Print
BX_KEY_PRINT = Sys_Req
BX_KEY_RIGHT = Right
BX_KEY_RIGHT_BRACKET = asciitilde
BX_KEY_RIGHT_BRACKET = asterisk
BX_KEY_RIGHT_BRACKET = plus
BX_KEY_SCRL_LOCK = Scroll_Lock
BX_KEY_SEMICOLON = Odiaeresis
BX_KEY_SEMICOLON = odiaeresis
BX_KEY_SHIFT_L = Shift_L
BX_KEY_SHIFT_R = Shift_R
BX_KEY_SINGLE_QUOTE = Adiaeresis
BX_KEY_SINGLE_QUOTE = adiaeresis
BX_KEY_SLASH = dead_belowdot
BX_KEY_SLASH = minus
BX_KEY_SLASH = underscore
BX_KEY_SPACE = space
BX_KEY_TAB = ISO_Left_Tab
BX_KEY_TAB = Tab
BX_KEY_UP = Up
BX_KEY_WIN_L = Super_L
BX_KEY_WIN_R = Super_R

View File

@ -0,0 +1,186 @@
# Bochs Keymap file : X11 - i386 - Spanish
# Author : Vicente Hernando Ara
#
# Format :
# Bochs key symbol = X11 key symbol (without XK_ prefix)
#
BX_KEY_0 = 0
BX_KEY_0 = equal
BX_KEY_1 = 1
BX_KEY_1 = bar
BX_KEY_1 = exclam
BX_KEY_2 = 2
BX_KEY_2 = at
BX_KEY_2 = quotedbl
BX_KEY_3 = 3
BX_KEY_3 = numbersign
BX_KEY_3 = periodcentered
BX_KEY_4 = 4
BX_KEY_4 = dollar
BX_KEY_5 = 5
BX_KEY_5 = percent
BX_KEY_6 = 6
BX_KEY_6 = ampersand
BX_KEY_7 = 7
BX_KEY_7 = slash
BX_KEY_8 = 8
BX_KEY_8 = parenleft
BX_KEY_9 = 9
BX_KEY_9 = parenright
BX_KEY_A = A
BX_KEY_A = a
BX_KEY_B = B
BX_KEY_B = b
BX_KEY_C = C
BX_KEY_C = c
BX_KEY_D = D
BX_KEY_D = d
BX_KEY_E = E
BX_KEY_E = EuroSign
BX_KEY_E = e
BX_KEY_F = F
BX_KEY_F = f
BX_KEY_G = G
BX_KEY_G = g
BX_KEY_H = H
BX_KEY_H = h
BX_KEY_I = I
BX_KEY_I = i
BX_KEY_J = J
BX_KEY_J = j
BX_KEY_K = K
BX_KEY_K = k
BX_KEY_L = L
BX_KEY_L = l
BX_KEY_M = M
BX_KEY_M = m
BX_KEY_N = N
BX_KEY_N = n
BX_KEY_O = O
BX_KEY_O = o
BX_KEY_P = P
BX_KEY_P = p
BX_KEY_Q = Q
BX_KEY_Q = q
BX_KEY_R = R
BX_KEY_R = r
BX_KEY_S = S
BX_KEY_S = s
BX_KEY_T = T
BX_KEY_T = t
BX_KEY_U = U
BX_KEY_U = u
BX_KEY_V = V
BX_KEY_V = v
BX_KEY_W = W
BX_KEY_W = w
BX_KEY_X = X
BX_KEY_X = x
BX_KEY_Y = Y
BX_KEY_Y = y
BX_KEY_Z = Z
BX_KEY_Z = z
BX_KEY_F1 = F1
BX_KEY_F2 = F2
BX_KEY_F3 = F3
BX_KEY_F4 = F4
BX_KEY_F5 = F5
BX_KEY_F6 = F6
BX_KEY_F7 = F7
BX_KEY_F8 = F8
BX_KEY_F9 = F9
BX_KEY_F10 = F10
BX_KEY_F11 = F11
BX_KEY_F12 = F12
BX_KEY_ALT_L = Alt_L
BX_KEY_ALT_L = Meta_L
BX_KEY_ALT_R = Mode_switch
BX_KEY_ALT_R = Multi_key
BX_KEY_BACKSLASH = Ccedilla
BX_KEY_BACKSLASH = ccedilla
BX_KEY_BACKSPACE = BackSpace
BX_KEY_CAPS_LOCK = Caps_Lock
BX_KEY_COMMA = comma
BX_KEY_COMMA = semicolon
BX_KEY_CTRL_L = Control_L
BX_KEY_CTRL_R = Control_R
BX_KEY_DELETE = Delete
BX_KEY_DOWN = Down
BX_KEY_END = End
BX_KEY_ENTER = Return
BX_KEY_EQUALS = exclamdown
BX_KEY_EQUALS = questiondown
BX_KEY_ESC = Escape
BX_KEY_GRAVE = asciitilde
BX_KEY_GRAVE = backslash
BX_KEY_GRAVE = grave
BX_KEY_GRAVE = masculine
BX_KEY_GRAVE = ordfeminine
BX_KEY_HOME = Home
BX_KEY_INSERT = Insert
BX_KEY_KP_5 = KP_5
BX_KEY_KP_5 = KP_Begin
BX_KEY_KP_ADD = KP_Add
BX_KEY_KP_DELETE = KP_Decimal
BX_KEY_KP_DELETE = KP_Delete
BX_KEY_KP_DIVIDE = KP_Divide
BX_KEY_KP_DOWN = KP_2
BX_KEY_KP_DOWN = KP_Down
BX_KEY_KP_END = KP_1
BX_KEY_KP_END = KP_End
BX_KEY_KP_ENTER = KP_Enter
BX_KEY_KP_HOME = KP_7
BX_KEY_KP_HOME = KP_Home
BX_KEY_KP_INSERT = KP_0
BX_KEY_KP_INSERT = KP_Insert
BX_KEY_KP_LEFT = KP_4
BX_KEY_KP_LEFT = KP_Left
BX_KEY_KP_MULTIPLY = KP_Multiply
BX_KEY_KP_PAGE_DOWN = KP_3
BX_KEY_KP_PAGE_DOWN = KP_Page_Down
BX_KEY_KP_PAGE_UP = KP_9
BX_KEY_KP_PAGE_UP = KP_Page_Up
BX_KEY_KP_RIGHT = KP_6
BX_KEY_KP_RIGHT = KP_Right
BX_KEY_KP_SUBTRACT = KP_Subtract
BX_KEY_KP_UP = KP_8
BX_KEY_KP_UP = KP_Up
BX_KEY_LEFT = Left
BX_KEY_LEFT_BACKSLASH = greater
BX_KEY_LEFT_BACKSLASH = less
BX_KEY_LEFT_BRACKET = braceleft
BX_KEY_LEFT_BRACKET = bracketleft
BX_KEY_LEFT_BRACKET = dead_circumflex
BX_KEY_LEFT_BRACKET = dead_grave
BX_KEY_MENU = Menu
BX_KEY_MINUS = apostrophe
BX_KEY_MINUS = question
BX_KEY_NUM_LOCK = Num_Lock
BX_KEY_PAGE_DOWN = Page_Down
BX_KEY_PAGE_UP = Page_Up
BX_KEY_PAUSE = Break
BX_KEY_PAUSE = Pause
BX_KEY_PERIOD = colon
BX_KEY_PERIOD = period
BX_KEY_PRINT = Print
BX_KEY_PRINT = Sys_Req
BX_KEY_RIGHT = Right
BX_KEY_RIGHT_BRACKET = asterisk
BX_KEY_RIGHT_BRACKET = braceright
BX_KEY_RIGHT_BRACKET = bracketright
BX_KEY_RIGHT_BRACKET = plus
BX_KEY_SCRL_LOCK = Scroll_Lock
BX_KEY_SEMICOLON = Ntilde
BX_KEY_SEMICOLON = ntilde
BX_KEY_SHIFT_L = Shift_L
BX_KEY_SHIFT_R = Shift_R
BX_KEY_SINGLE_QUOTE = dead_acute
BX_KEY_SINGLE_QUOTE = dead_diaeresis
BX_KEY_SLASH = minus
BX_KEY_SLASH = underscore
BX_KEY_SPACE = space
BX_KEY_TAB = ISO_Left_Tab
BX_KEY_TAB = Tab
BX_KEY_UP = Up
BX_KEY_WIN_L = Super_L
BX_KEY_WIN_R = Super_R

View File

@ -0,0 +1,187 @@
# Bochs Keymap file : X11 - i386 - French
# Author : Christophe Bothamy
#
# Format :
# Bochs key symbol = X11 key symbol (without XK_ prefix)
#
BX_KEY_0 = 0
BX_KEY_0 = agrave
BX_KEY_0 = at
BX_KEY_1 = 1
BX_KEY_1 = ampersand
BX_KEY_2 = 2
BX_KEY_2 = asciitilde
BX_KEY_2 = eacute
BX_KEY_3 = 3
BX_KEY_3 = numbersign
BX_KEY_3 = quotedbl
BX_KEY_4 = 4
BX_KEY_4 = apostrophe
BX_KEY_4 = braceleft
BX_KEY_5 = 5
BX_KEY_5 = bracketleft
BX_KEY_5 = parenleft
BX_KEY_6 = 6
BX_KEY_6 = bar
BX_KEY_6 = minus
BX_KEY_7 = 7
BX_KEY_7 = egrave
BX_KEY_7 = grave
BX_KEY_8 = 8
BX_KEY_8 = backslash
BX_KEY_8 = underscore
BX_KEY_9 = 9
BX_KEY_9 = asciicircum
BX_KEY_9 = ccedilla
BX_KEY_A = Q
BX_KEY_A = q
BX_KEY_B = B
BX_KEY_B = b
BX_KEY_C = C
BX_KEY_C = c
BX_KEY_D = D
BX_KEY_D = d
BX_KEY_E = E
BX_KEY_E = e
BX_KEY_E = EuroSign
BX_KEY_F = F
BX_KEY_F = f
BX_KEY_G = G
BX_KEY_G = g
BX_KEY_H = H
BX_KEY_H = h
BX_KEY_I = I
BX_KEY_I = i
BX_KEY_J = J
BX_KEY_J = j
BX_KEY_K = K
BX_KEY_K = k
BX_KEY_L = L
BX_KEY_L = l
BX_KEY_M = comma
BX_KEY_M = question
BX_KEY_N = N
BX_KEY_N = n
BX_KEY_O = O
BX_KEY_O = o
BX_KEY_P = P
BX_KEY_P = p
BX_KEY_Q = A
BX_KEY_Q = a
BX_KEY_R = R
BX_KEY_R = r
BX_KEY_S = S
BX_KEY_S = s
BX_KEY_T = T
BX_KEY_T = t
BX_KEY_U = U
BX_KEY_U = u
BX_KEY_V = V
BX_KEY_V = v
BX_KEY_W = Z
BX_KEY_W = z
BX_KEY_X = X
BX_KEY_X = x
BX_KEY_Y = Y
BX_KEY_Y = y
BX_KEY_Z = W
BX_KEY_Z = w
BX_KEY_F1 = F1
BX_KEY_F2 = F2
BX_KEY_F3 = F3
BX_KEY_F4 = F4
BX_KEY_F5 = F5
BX_KEY_F6 = F6
BX_KEY_F7 = F7
BX_KEY_F8 = F8
BX_KEY_F9 = F9
BX_KEY_F10 = F10
BX_KEY_F11 = F11
BX_KEY_F12 = F12
BX_KEY_ALT_L = Alt_L
BX_KEY_ALT_L = Meta_L
BX_KEY_ALT_R = Mode_switch
BX_KEY_ALT_R = Multi_key
BX_KEY_BACKSLASH = asterisk
BX_KEY_BACKSLASH = mu
BX_KEY_BACKSPACE = BackSpace
BX_KEY_CAPS_LOCK = Caps_Lock
BX_KEY_COMMA = period
BX_KEY_COMMA = semicolon
BX_KEY_CTRL_L = Control_L
BX_KEY_CTRL_R = Control_R
BX_KEY_DELETE = Delete
BX_KEY_DOWN = Down
BX_KEY_END = End
BX_KEY_ENTER = Return
BX_KEY_EQUALS = braceright
BX_KEY_EQUALS = equal
BX_KEY_EQUALS = plus
BX_KEY_ESC = Escape
BX_KEY_GRAVE = twosuperior
BX_KEY_HOME = Home
BX_KEY_INSERT = Insert
BX_KEY_KP_5 = KP_5
BX_KEY_KP_5 = KP_Begin
BX_KEY_KP_ADD = KP_Add
BX_KEY_KP_DELETE = KP_Decimal
BX_KEY_KP_DELETE = KP_Delete
BX_KEY_KP_DIVIDE = KP_Divide
BX_KEY_KP_DOWN = KP_2
BX_KEY_KP_DOWN = KP_Down
BX_KEY_KP_END = KP_1
BX_KEY_KP_END = KP_End
BX_KEY_KP_ENTER = KP_Enter
BX_KEY_KP_HOME = KP_7
BX_KEY_KP_HOME = KP_Home
BX_KEY_KP_INSERT = KP_0
BX_KEY_KP_INSERT = KP_Insert
BX_KEY_KP_LEFT = KP_4
BX_KEY_KP_LEFT = KP_Left
BX_KEY_KP_MULTIPLY = KP_Multiply
BX_KEY_KP_PAGE_DOWN = KP_3
BX_KEY_KP_PAGE_DOWN = KP_Page_Down
BX_KEY_KP_PAGE_UP = KP_9
BX_KEY_KP_PAGE_UP = KP_Page_Up
BX_KEY_KP_RIGHT = KP_6
BX_KEY_KP_RIGHT = KP_Right
BX_KEY_KP_SUBTRACT = KP_Subtract
BX_KEY_KP_UP = KP_8
BX_KEY_KP_UP = KP_Up
BX_KEY_LEFT = Left
BX_KEY_LEFT_BACKSLASH = greater
BX_KEY_LEFT_BACKSLASH = less
BX_KEY_LEFT_BRACKET = dead_circumflex
BX_KEY_LEFT_BRACKET = dead_diaeresis
BX_KEY_MENU = Menu
BX_KEY_MINUS = bracketright
BX_KEY_MINUS = degree
BX_KEY_MINUS = parenright
BX_KEY_NUM_LOCK = Num_Lock
BX_KEY_PAGE_DOWN = Page_Down
BX_KEY_PAGE_UP = Page_Up
BX_KEY_PAUSE = Break
BX_KEY_PAUSE = Pause
BX_KEY_PERIOD = colon
BX_KEY_PERIOD = slash
BX_KEY_PRINT = Print
BX_KEY_PRINT = Sys_Req
BX_KEY_RIGHT = Right
BX_KEY_RIGHT_BRACKET = currency
BX_KEY_RIGHT_BRACKET = dollar
BX_KEY_RIGHT_BRACKET = sterling
BX_KEY_SCRL_LOCK = Scroll_Lock
BX_KEY_SEMICOLON = M
BX_KEY_SEMICOLON = m
BX_KEY_SHIFT_L = Shift_L
BX_KEY_SHIFT_R = Shift_R
BX_KEY_SINGLE_QUOTE = percent
BX_KEY_SINGLE_QUOTE = ugrave
BX_KEY_SLASH = exclam
BX_KEY_SLASH = section
BX_KEY_SPACE = space
BX_KEY_TAB = ISO_Left_Tab
BX_KEY_TAB = Tab
BX_KEY_UP = Up
BX_KEY_WIN_L = Super_L
BX_KEY_WIN_R = Super_R

View File

@ -0,0 +1,172 @@
# Bochs Keymap file : X11 - i386 - US
# Author : the Bochs team
#
# Format :
# Bochs key symbol = X11 key symbol (without XK_ prefix)
#
BX_KEY_0 = 0
BX_KEY_0 = parenright
BX_KEY_1 = 1
BX_KEY_1 = exclam
BX_KEY_2 = 2
BX_KEY_2 = at
BX_KEY_3 = 3
BX_KEY_3 = numbersign
BX_KEY_4 = 4
BX_KEY_4 = dollar
BX_KEY_5 = 5
BX_KEY_5 = percent
BX_KEY_6 = 6
BX_KEY_7 = 7
BX_KEY_7 = ampersand
BX_KEY_8 = 8
BX_KEY_8 = asterisk
BX_KEY_9 = 9
BX_KEY_9 = parenleft
BX_KEY_A = A
BX_KEY_A = a
BX_KEY_B = B
BX_KEY_B = b
BX_KEY_C = C
BX_KEY_C = c
BX_KEY_D = D
BX_KEY_D = d
BX_KEY_E = E
BX_KEY_E = e
BX_KEY_F = F
BX_KEY_F = f
BX_KEY_G = G
BX_KEY_G = g
BX_KEY_H = H
BX_KEY_H = h
BX_KEY_I = I
BX_KEY_I = i
BX_KEY_J = J
BX_KEY_J = j
BX_KEY_K = K
BX_KEY_K = k
BX_KEY_L = L
BX_KEY_L = l
BX_KEY_M = M
BX_KEY_M = m
BX_KEY_N = N
BX_KEY_N = n
BX_KEY_O = O
BX_KEY_O = o
BX_KEY_P = P
BX_KEY_P = p
BX_KEY_Q = Q
BX_KEY_Q = q
BX_KEY_R = R
BX_KEY_R = r
BX_KEY_S = S
BX_KEY_S = s
BX_KEY_T = T
BX_KEY_T = t
BX_KEY_U = U
BX_KEY_U = u
BX_KEY_V = V
BX_KEY_V = v
BX_KEY_W = W
BX_KEY_W = w
BX_KEY_X = X
BX_KEY_X = x
BX_KEY_Y = Y
BX_KEY_Y = y
BX_KEY_Z = Z
BX_KEY_Z = z
BX_KEY_F1 = F1
BX_KEY_F2 = F2
BX_KEY_F3 = F3
BX_KEY_F4 = F4
BX_KEY_F5 = F5
BX_KEY_F6 = F6
BX_KEY_F7 = F7
BX_KEY_F8 = F8
BX_KEY_F9 = F9
BX_KEY_F10 = F10
BX_KEY_F11 = F11
BX_KEY_F12 = F12
BX_KEY_ALT_L = Alt_L
BX_KEY_ALT_L = Meta_L
BX_KEY_ALT_R = Mode_switch
BX_KEY_ALT_R = Multi_key
BX_KEY_BACKSLASH = backslash
BX_KEY_BACKSLASH = bar
BX_KEY_BACKSPACE = BackSpace
BX_KEY_CAPS_LOCK = Caps_Lock
BX_KEY_COMMA = comma
BX_KEY_COMMA = less
BX_KEY_CTRL_L = Control_L
BX_KEY_CTRL_R = Control_R
BX_KEY_DELETE = Delete
BX_KEY_DOWN = Down
BX_KEY_END = End
BX_KEY_ENTER = Return
BX_KEY_EQUALS = equal
BX_KEY_EQUALS = plus
BX_KEY_ESC = Escape
BX_KEY_GRAVE = asciitilde
BX_KEY_GRAVE = grave
BX_KEY_HOME = Home
BX_KEY_INSERT = Insert
BX_KEY_KP_5 = KP_5
BX_KEY_KP_5 = KP_Begin
BX_KEY_KP_ADD = KP_Add
BX_KEY_KP_DELETE = KP_Decimal
BX_KEY_KP_DELETE = KP_Delete
BX_KEY_KP_DIVIDE = KP_Divide
BX_KEY_KP_DOWN = KP_2
BX_KEY_KP_DOWN = KP_Down
BX_KEY_KP_END = KP_1
BX_KEY_KP_END = KP_End
BX_KEY_KP_ENTER = KP_Enter
BX_KEY_KP_HOME = KP_7
BX_KEY_KP_HOME = KP_Home
BX_KEY_KP_INSERT = KP_0
BX_KEY_KP_INSERT = KP_Insert
BX_KEY_KP_LEFT = KP_4
BX_KEY_KP_LEFT = KP_Left
BX_KEY_KP_MULTIPLY = KP_Multiply
BX_KEY_KP_PAGE_DOWN = KP_3
BX_KEY_KP_PAGE_DOWN = KP_Page_Down
BX_KEY_KP_PAGE_UP = KP_9
BX_KEY_KP_PAGE_UP = KP_Page_Up
BX_KEY_KP_RIGHT = KP_6
BX_KEY_KP_RIGHT = KP_Right
BX_KEY_KP_SUBTRACT = KP_Subtract
BX_KEY_KP_UP = KP_8
BX_KEY_KP_UP = KP_Up
BX_KEY_LEFT = Left
BX_KEY_LEFT_BRACKET = braceleft
BX_KEY_LEFT_BRACKET = bracketleft
BX_KEY_MENU = Menu
BX_KEY_MINUS = minus
BX_KEY_MINUS = underscore
BX_KEY_NUM_LOCK = Num_Lock
BX_KEY_PAGE_DOWN = Page_Down
BX_KEY_PAGE_UP = Page_Up
BX_KEY_PAUSE = Break
BX_KEY_PAUSE = Pause
BX_KEY_PERIOD = greater
BX_KEY_PERIOD = period
BX_KEY_PRINT = Print
BX_KEY_PRINT = Sys_Req
BX_KEY_RIGHT = Right
BX_KEY_RIGHT_BRACKET = braceright
BX_KEY_RIGHT_BRACKET = bracketright
BX_KEY_SCRL_LOCK = Scroll_Lock
BX_KEY_SEMICOLON = colon
BX_KEY_SEMICOLON = semicolon
BX_KEY_SHIFT_L = Shift_L
BX_KEY_SHIFT_R = Shift_R
BX_KEY_SINGLE_QUOTE = apostrophe
BX_KEY_SINGLE_QUOTE = quotedbl
BX_KEY_SLASH = question
BX_KEY_SLASH = slash
BX_KEY_SPACE = space
BX_KEY_TAB = ISO_Left_Tab
BX_KEY_TAB = Tab
BX_KEY_UP = Up
BX_KEY_WIN_L = Super_L
BX_KEY_WIN_R = Super_R

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// $Id: x.cc,v 1.32 2002-03-05 15:42:02 grossman Exp $ // $Id: x.cc,v 1.33 2002-03-06 09:31:55 cbothamy Exp $
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// //
// Copyright (C) 2002 MandrakeSoft S.A. // Copyright (C) 2002 MandrakeSoft S.A.
@ -24,11 +24,6 @@
// License along with this library; if not, write to the Free Software // License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// Keyboard Mapping Todo
// . Add more keymaps. For now we only have us, fr and de
// . The tables should be moved in separate file so it can be edited by the user
// . The keymap files name should contain the GUI and keymap name, eg x-us
#define XK_PUBLISHING #define XK_PUBLISHING
#define XK_TECHNICAL #define XK_TECHNICAL
@ -89,6 +84,8 @@ static void warp_cursor(int dx, int dy);
static void disable_cursor(); static void disable_cursor();
static void enable_cursor(); static void enable_cursor();
static Bit32u convertStringToXKeysym (const char *string);
struct { struct {
Pixmap bmap; Pixmap bmap;
unsigned xdim; unsigned xdim;
@ -239,565 +236,6 @@ Bit32u ascii_to_key_event[0x5f] = {
BX_KEY_GRAVE BX_KEY_GRAVE
}; };
/* US key mapping. Also the default */
Bit32u keymap_us[][2] = {
{ XK_space , BX_KEY_SPACE },
{ XK_exclam , BX_KEY_1 },
{ XK_quotedbl , BX_KEY_SINGLE_QUOTE },
{ XK_numbersign , BX_KEY_3 },
{ XK_dollar , BX_KEY_4 },
{ XK_percent , BX_KEY_5 },
{ XK_ampersand , BX_KEY_7 },
{ XK_apostrophe , BX_KEY_SINGLE_QUOTE },
{ XK_parenleft , BX_KEY_9 },
{ XK_parenright , BX_KEY_0 },
{ XK_asterisk , BX_KEY_8 },
{ XK_plus , BX_KEY_EQUALS },
{ XK_comma , BX_KEY_COMMA },
{ XK_minus , BX_KEY_MINUS },
{ XK_period , BX_KEY_PERIOD },
{ XK_slash , BX_KEY_SLASH },
{ XK_0 , BX_KEY_0 },
{ XK_1 , BX_KEY_1 },
{ XK_2 , BX_KEY_2 },
{ XK_3 , BX_KEY_3 },
{ XK_4 , BX_KEY_4 },
{ XK_5 , BX_KEY_5 },
{ XK_6 , BX_KEY_6 },
{ XK_7 , BX_KEY_7 },
{ XK_8 , BX_KEY_8 },
{ XK_9 , BX_KEY_9 },
{ XK_colon , BX_KEY_SEMICOLON },
{ XK_semicolon , BX_KEY_SEMICOLON },
{ XK_less , BX_KEY_COMMA },
{ XK_equal , BX_KEY_EQUALS },
{ XK_greater , BX_KEY_PERIOD },
{ XK_question , BX_KEY_SLASH },
{ XK_at , BX_KEY_2 },
{ XK_A , BX_KEY_A },
{ XK_B , BX_KEY_B },
{ XK_C , BX_KEY_C },
{ XK_D , BX_KEY_D },
{ XK_E , BX_KEY_E },
{ XK_F , BX_KEY_F },
{ XK_G , BX_KEY_G },
{ XK_H , BX_KEY_H },
{ XK_I , BX_KEY_I },
{ XK_J , BX_KEY_J },
{ XK_K , BX_KEY_K },
{ XK_L , BX_KEY_L },
{ XK_M , BX_KEY_M },
{ XK_N , BX_KEY_N },
{ XK_O , BX_KEY_O },
{ XK_P , BX_KEY_P },
{ XK_Q , BX_KEY_Q },
{ XK_R , BX_KEY_R },
{ XK_S , BX_KEY_S },
{ XK_T , BX_KEY_T },
{ XK_U , BX_KEY_U },
{ XK_V , BX_KEY_V },
{ XK_W , BX_KEY_W },
{ XK_X , BX_KEY_X },
{ XK_Y , BX_KEY_Y },
{ XK_Z , BX_KEY_Z },
{ XK_bracketleft , BX_KEY_LEFT_BRACKET },
{ XK_backslash , BX_KEY_BACKSLASH },
{ XK_bracketright , BX_KEY_RIGHT_BRACKET },
{ XK_underscore , BX_KEY_MINUS },
{ XK_grave , BX_KEY_GRAVE },
{ XK_a , BX_KEY_A },
{ XK_b , BX_KEY_B },
{ XK_c , BX_KEY_C },
{ XK_d , BX_KEY_D },
{ XK_e , BX_KEY_E },
{ XK_f , BX_KEY_F },
{ XK_g , BX_KEY_G },
{ XK_h , BX_KEY_H },
{ XK_i , BX_KEY_I },
{ XK_j , BX_KEY_J },
{ XK_k , BX_KEY_K },
{ XK_l , BX_KEY_L },
{ XK_m , BX_KEY_M },
{ XK_n , BX_KEY_N },
{ XK_o , BX_KEY_O },
{ XK_p , BX_KEY_P },
{ XK_q , BX_KEY_Q },
{ XK_r , BX_KEY_R },
{ XK_s , BX_KEY_S },
{ XK_t , BX_KEY_T },
{ XK_u , BX_KEY_U },
{ XK_v , BX_KEY_V },
{ XK_w , BX_KEY_W },
{ XK_x , BX_KEY_X },
{ XK_y , BX_KEY_Y },
{ XK_z , BX_KEY_Z },
{ XK_braceleft , BX_KEY_LEFT_BRACKET },
{ XK_bar , BX_KEY_BACKSLASH },
{ XK_braceright , BX_KEY_RIGHT_BRACKET },
{ XK_asciitilde , BX_KEY_GRAVE },
{ XK_KP_1 , BX_KEY_KP_END },
#ifdef XK_KP_End
{ XK_KP_End , BX_KEY_KP_END },
#endif
{ XK_KP_2 , BX_KEY_KP_DOWN },
#ifdef XK_KP_Down
{ XK_KP_Down , BX_KEY_KP_DOWN },
#endif
{ XK_KP_3 , BX_KEY_KP_PAGE_DOWN },
#ifdef XK_KP_Page_Down
{ XK_KP_Page_Down , BX_KEY_KP_PAGE_DOWN },
#endif
{ XK_KP_4 , BX_KEY_KP_LEFT },
#ifdef XK_KP_Left
{ XK_KP_Left , BX_KEY_KP_LEFT },
#endif
{ XK_KP_5 , BX_KEY_KP_5 },
{ XK_KP_6 , BX_KEY_KP_RIGHT },
#ifdef XK_KP_Right
{ XK_KP_Right , BX_KEY_KP_RIGHT },
#endif
{ XK_KP_7 , BX_KEY_KP_HOME },
#ifdef XK_KP_Home
{ XK_KP_Home , BX_KEY_KP_HOME },
#endif
{ XK_KP_8 , BX_KEY_KP_UP },
#ifdef XK_KP_Up
{ XK_KP_Up , BX_KEY_KP_UP },
#endif
{ XK_KP_9 , BX_KEY_KP_PAGE_UP },
#ifdef XK_KP_Page_Up
{ XK_KP_Page_Up , BX_KEY_KP_PAGE_UP },
#endif
{ XK_KP_0 , BX_KEY_KP_INSERT },
#ifdef XK_KP_Insert
{ XK_KP_Insert , BX_KEY_KP_INSERT },
#endif
{ XK_KP_Decimal , BX_KEY_KP_DELETE },
#ifdef XK_KP_Delete
{ XK_KP_Delete , BX_KEY_KP_DELETE },
#endif
#ifdef XK_KP_Enter
{ XK_KP_Enter , BX_KEY_KP_ENTER },
#endif
{ XK_KP_Subtract , BX_KEY_KP_SUBTRACT },
{ XK_KP_Add , BX_KEY_KP_ADD },
{ XK_KP_Multiply , BX_KEY_KP_MULTIPLY },
{ XK_KP_Divide , BX_KEY_KP_DIVIDE },
{ XK_Up , BX_KEY_UP },
{ XK_Down , BX_KEY_DOWN },
{ XK_Left , BX_KEY_LEFT },
{ XK_Right , BX_KEY_RIGHT },
{ XK_Delete , BX_KEY_DELETE },
{ XK_BackSpace , BX_KEY_BACKSPACE },
{ XK_Tab , BX_KEY_TAB },
{ XK_Return , BX_KEY_ENTER },
{ XK_Escape , BX_KEY_ESC },
{ XK_F1 , BX_KEY_F1 },
{ XK_F2 , BX_KEY_F2 },
{ XK_F3 , BX_KEY_F3 },
{ XK_F4 , BX_KEY_F4 },
{ XK_F5 , BX_KEY_F5 },
{ XK_F6 , BX_KEY_F6 },
{ XK_F7 , BX_KEY_F7 },
{ XK_F8 , BX_KEY_F8 },
{ XK_F9 , BX_KEY_F9 },
{ XK_F10 , BX_KEY_F10 },
{ XK_F11 , BX_KEY_F11 },
{ XK_F12 , BX_KEY_F12 },
{ XK_Control_L , BX_KEY_CTRL_L },
{ XK_Shift_L , BX_KEY_SHIFT_L },
{ XK_Shift_R , BX_KEY_SHIFT_R },
{ XK_Caps_Lock , BX_KEY_CAPS_LOCK },
{ XK_Num_Lock , BX_KEY_NUM_LOCK },
{ XK_Alt_L , BX_KEY_ALT_L },
{ XK_Insert , BX_KEY_INSERT },
{ XK_Home , BX_KEY_HOME },
{ XK_End , BX_KEY_END },
{ XK_Page_Up , BX_KEY_PAGE_UP },
{ XK_Page_Down , BX_KEY_PAGE_DOWN },
{ XK_Meta_L , BX_KEY_ALT_L },
{ XK_Mode_switch , BX_KEY_ALT_R },
{ XK_Multi_key , BX_KEY_ALT_R },
};
/*
=====================================
How to write your own mapping table :
=====================================
Just look at each key of the US Keyboard, and write down
what you see on your real keyboard
This gives you the XK_* symbol (your keyboard)
and the BX_KEY_* symbol (US keyboard)
NB : you may have to add your country specific X11 keysyms
and don't forget to add a line for every symbol you can type
on each key
*/
/*
US Keyboard looks like this:
Top Row from left to right
Esc F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12
2nd row from left to right
` 1 2 3 4 5 6 7 8 9 0 - = \ Back
3rd row from left to right
Tab Q W E R T Y U I O P [ ] Enter
4rd row from left to right
Caps A S D F G H J K L ; '
5rd row from left to right
lShift l\ Z X C V B N M , . / rShift
6rd row from left to right
lCtrl lAlt Space rAlt rCtrl
*/
/* ES (Spanish) key mapping, thanks to Vicente Hernando Ara */
Bit32u keymap_es[][2] = {
{ XK_bar , BX_KEY_1 },
{ XK_dead_acute , BX_KEY_SINGLE_QUOTE },
{ XK_periodcentered , BX_KEY_3 },
{ XK_slash , BX_KEY_7 },
{ XK_dead_diaeresis , BX_KEY_SINGLE_QUOTE },
{ XK_parenright , BX_KEY_9 },
{ XK_equal , BX_KEY_0 },
{ XK_parenleft , BX_KEY_8 },
{ XK_questiondown , BX_KEY_EQUALS },
{ XK_comma , BX_KEY_COMMA },
{ XK_apostrophe , BX_KEY_MINUS },
{ XK_period , BX_KEY_PERIOD },
{ XK_underscore , BX_KEY_SLASH },
{ XK_minus , BX_KEY_SLASH },
{ XK_Ntilde , BX_KEY_SEMICOLON },
{ XK_ntilde , BX_KEY_SEMICOLON },
{ XK_semicolon , BX_KEY_COMMA },
{ XK_exclamdown , BX_KEY_EQUALS },
{ XK_colon , BX_KEY_PERIOD },
{ XK_underscore , BX_KEY_SLASH },
{ XK_at , BX_KEY_2 },
{ XK_quotedbl , BX_KEY_2 },
{ XK_dead_grave , BX_KEY_LEFT_BRACKET },
{ XK_Ccedilla , BX_KEY_BACKSLASH },
{ XK_plus , BX_KEY_RIGHT_BRACKET },
{ XK_ampersand , BX_KEY_6 },
{ XK_question , BX_KEY_MINUS },
{ XK_masculine , BX_KEY_GRAVE },
{ XK_backslash , BX_KEY_GRAVE },
#ifdef XK_EuroSign
{ XK_EuroSign , BX_KEY_E },
#endif
{ XK_dead_circumflex , BX_KEY_LEFT_BRACKET },
{ XK_ccedilla , BX_KEY_BACKSLASH },
{ XK_asterisk , BX_KEY_RIGHT_BRACKET },
{ XK_ordfeminine , BX_KEY_GRAVE },
{ XK_less , BX_KEY_LEFT_BACKSLASH },
{ XK_greater , BX_KEY_LEFT_BACKSLASH },
{ XK_Control_R , BX_KEY_CTRL_R },
};
/* French key mapping. Applied as a diff to the default */
Bit32u keymap_fr[][2] = {
{ XK_twosuperior , BX_KEY_GRAVE },
{ XK_ampersand , BX_KEY_1 },
{ XK_eacute , BX_KEY_2 },
{ XK_asciitilde , BX_KEY_2 },
{ XK_quotedbl , BX_KEY_3 },
{ XK_numbersign , BX_KEY_3 },
{ XK_apostrophe , BX_KEY_4 },
{ XK_braceleft , BX_KEY_4 },
{ XK_parenleft , BX_KEY_5 },
{ XK_bracketleft , BX_KEY_5 },
{ XK_minus , BX_KEY_6 },
{ XK_bar , BX_KEY_6 },
{ XK_egrave , BX_KEY_7 },
{ XK_grave , BX_KEY_7 },
{ XK_underscore , BX_KEY_8 },
{ XK_backslash , BX_KEY_8 },
{ XK_ccedilla , BX_KEY_9 },
{ XK_asciicircum , BX_KEY_9 },
{ XK_agrave , BX_KEY_0 },
{ XK_at , BX_KEY_0 },
{ XK_parenright , BX_KEY_MINUS },
{ XK_degree , BX_KEY_MINUS },
{ XK_bracketright , BX_KEY_MINUS },
{ XK_equal , BX_KEY_EQUALS },
{ XK_plus , BX_KEY_EQUALS },
{ XK_braceright , BX_KEY_EQUALS },
{ XK_asterisk , BX_KEY_BACKSLASH },
{ XK_mu , BX_KEY_BACKSLASH },
{ XK_A , BX_KEY_Q },
{ XK_a , BX_KEY_Q },
{ XK_Z , BX_KEY_W },
{ XK_z , BX_KEY_W },
{ XK_dead_circumflex , BX_KEY_LEFT_BRACKET },
{ XK_dead_diaeresis , BX_KEY_LEFT_BRACKET },
{ XK_dollar , BX_KEY_RIGHT_BRACKET },
{ XK_sterling , BX_KEY_RIGHT_BRACKET },
{ XK_currency , BX_KEY_RIGHT_BRACKET },
{ XK_Q , BX_KEY_A },
{ XK_q , BX_KEY_A },
{ XK_M , BX_KEY_SEMICOLON },
{ XK_m , BX_KEY_SEMICOLON },
{ XK_ugrave , BX_KEY_SINGLE_QUOTE },
{ XK_percent , BX_KEY_SINGLE_QUOTE },
{ XK_less , BX_KEY_LEFT_BACKSLASH },
{ XK_greater , BX_KEY_LEFT_BACKSLASH },
{ XK_W , BX_KEY_Z },
{ XK_w , BX_KEY_Z },
{ XK_comma , BX_KEY_M },
{ XK_question , BX_KEY_M },
{ XK_semicolon , BX_KEY_COMMA },
{ XK_period , BX_KEY_COMMA },
{ XK_colon , BX_KEY_PERIOD },
{ XK_slash , BX_KEY_PERIOD },
{ XK_exclam , BX_KEY_SLASH },
{ XK_section , BX_KEY_SLASH },
};
// Full German key mapping, thanks to Volker Ruppert
Bit32u keymap_de[][2] = {
{ XK_space , BX_KEY_SPACE },
{ XK_exclam , BX_KEY_1 },
{ XK_quotedbl , BX_KEY_2 },
{ XK_numbersign , BX_KEY_BACKSLASH },
{ XK_dollar , BX_KEY_4 },
{ XK_percent , BX_KEY_5 },
{ XK_ampersand , BX_KEY_6 },
{ XK_apostrophe , BX_KEY_BACKSLASH },
{ XK_parenleft , BX_KEY_8 },
{ XK_parenright , BX_KEY_9 },
{ XK_asterisk , BX_KEY_RIGHT_BRACKET },
{ XK_plus , BX_KEY_RIGHT_BRACKET },
{ XK_comma , BX_KEY_COMMA },
{ XK_minus , BX_KEY_SLASH },
{ XK_period , BX_KEY_PERIOD },
{ XK_slash , BX_KEY_7 },
{ XK_0 , BX_KEY_0 },
{ XK_1 , BX_KEY_1 },
{ XK_2 , BX_KEY_2 },
{ XK_3 , BX_KEY_3 },
{ XK_4 , BX_KEY_4 },
{ XK_5 , BX_KEY_5 },
{ XK_6 , BX_KEY_6 },
{ XK_7 , BX_KEY_7 },
{ XK_8 , BX_KEY_8 },
{ XK_9 , BX_KEY_9 },
{ XK_colon , BX_KEY_PERIOD },
{ XK_semicolon , BX_KEY_COMMA },
{ XK_less , BX_KEY_LEFT_BACKSLASH },
{ XK_equal , BX_KEY_0 },
{ XK_greater , BX_KEY_LEFT_BACKSLASH },
{ XK_question , BX_KEY_MINUS },
{ XK_at , BX_KEY_Q },
{ XK_A , BX_KEY_A },
{ XK_B , BX_KEY_B },
{ XK_C , BX_KEY_C },
{ XK_D , BX_KEY_D },
{ XK_E , BX_KEY_E },
{ XK_F , BX_KEY_F },
{ XK_G , BX_KEY_G },
{ XK_H , BX_KEY_H },
{ XK_I , BX_KEY_I },
{ XK_J , BX_KEY_J },
{ XK_K , BX_KEY_K },
{ XK_L , BX_KEY_L },
{ XK_M , BX_KEY_M },
{ XK_N , BX_KEY_N },
{ XK_O , BX_KEY_O },
{ XK_P , BX_KEY_P },
{ XK_Q , BX_KEY_Q },
{ XK_R , BX_KEY_R },
{ XK_S , BX_KEY_S },
{ XK_T , BX_KEY_T },
{ XK_U , BX_KEY_U },
{ XK_V , BX_KEY_V },
{ XK_W , BX_KEY_W },
{ XK_X , BX_KEY_X },
{ XK_Y , BX_KEY_Z },
{ XK_Z , BX_KEY_Y },
{ XK_bracketleft , BX_KEY_8 },
{ XK_backslash , BX_KEY_MINUS },
{ XK_bracketright , BX_KEY_9 },
{ XK_asciicircum , BX_KEY_GRAVE },
{ XK_underscore , BX_KEY_SLASH },
{ XK_grave , BX_KEY_EQUALS },
{ XK_a , BX_KEY_A },
{ XK_b , BX_KEY_B },
{ XK_c , BX_KEY_C },
{ XK_d , BX_KEY_D },
{ XK_e , BX_KEY_E },
{ XK_f , BX_KEY_F },
{ XK_g , BX_KEY_G },
{ XK_h , BX_KEY_H },
{ XK_i , BX_KEY_I },
{ XK_j , BX_KEY_J },
{ XK_k , BX_KEY_K },
{ XK_l , BX_KEY_L },
{ XK_m , BX_KEY_M },
{ XK_n , BX_KEY_N },
{ XK_o , BX_KEY_O },
{ XK_p , BX_KEY_P },
{ XK_q , BX_KEY_Q },
{ XK_r , BX_KEY_R },
{ XK_s , BX_KEY_S },
{ XK_t , BX_KEY_T },
{ XK_u , BX_KEY_U },
{ XK_v , BX_KEY_V },
{ XK_w , BX_KEY_W },
{ XK_x , BX_KEY_X },
{ XK_y , BX_KEY_Z },
{ XK_z , BX_KEY_Y },
{ XK_braceleft , BX_KEY_7 },
{ XK_bar , BX_KEY_LEFT_BACKSLASH },
{ XK_braceright , BX_KEY_0 },
{ XK_asciitilde , BX_KEY_RIGHT_BRACKET },
{ XK_KP_1 , BX_KEY_KP_END },
#ifdef XK_KP_End
{ XK_KP_End , BX_KEY_KP_END },
#endif
{ XK_KP_2 , BX_KEY_KP_DOWN },
#ifdef XK_KP_Down
{ XK_KP_Down , BX_KEY_KP_DOWN },
#endif
{ XK_KP_3 , BX_KEY_KP_PAGE_DOWN },
#ifdef XK_KP_Page_Down
{ XK_KP_Page_Down , BX_KEY_KP_PAGE_DOWN },
#endif
{ XK_KP_4 , BX_KEY_KP_LEFT },
#ifdef XK_KP_Left
{ XK_KP_Left , BX_KEY_KP_LEFT },
#endif
{ XK_KP_5 , BX_KEY_KP_5 },
{ XK_KP_6 , BX_KEY_KP_RIGHT },
#ifdef XK_KP_Right
{ XK_KP_Right , BX_KEY_KP_RIGHT },
#endif
{ XK_KP_7 , BX_KEY_KP_HOME },
#ifdef XK_KP_Home
{ XK_KP_Home , BX_KEY_KP_HOME },
#endif
{ XK_KP_8 , BX_KEY_KP_UP },
#ifdef XK_KP_Up
{ XK_KP_Up , BX_KEY_KP_UP },
#endif
{ XK_KP_9 , BX_KEY_KP_PAGE_UP },
#ifdef XK_KP_Page_Up
{ XK_KP_Page_Up , BX_KEY_KP_PAGE_UP },
#endif
{ XK_KP_0 , BX_KEY_KP_INSERT },
#ifdef XK_KP_Insert
{ XK_KP_Insert , BX_KEY_KP_INSERT },
#endif
{ XK_KP_Decimal , BX_KEY_KP_DELETE },
#ifdef XK_KP_Delete
{ XK_KP_Delete , BX_KEY_KP_DELETE },
#endif
#ifdef XK_KP_Enter
{ XK_KP_Enter , BX_KEY_KP_ENTER },
#endif
{ XK_KP_Subtract , BX_KEY_KP_SUBTRACT },
{ XK_KP_Add , BX_KEY_KP_ADD },
{ XK_KP_Multiply , BX_KEY_KP_MULTIPLY },
{ XK_KP_Divide , BX_KEY_KP_DIVIDE },
{ XK_Up , BX_KEY_UP },
{ XK_Down , BX_KEY_DOWN },
{ XK_Left , BX_KEY_LEFT },
{ XK_Right , BX_KEY_RIGHT },
{ XK_Delete , BX_KEY_DELETE },
{ XK_BackSpace , BX_KEY_BACKSPACE },
{ XK_Tab , BX_KEY_TAB },
{ XK_Return , BX_KEY_ENTER },
{ XK_Escape , BX_KEY_ESC },
{ XK_F1 , BX_KEY_F1 },
{ XK_F2 , BX_KEY_F2 },
{ XK_F3 , BX_KEY_F3 },
{ XK_F4 , BX_KEY_F4 },
{ XK_F5 , BX_KEY_F5 },
{ XK_F6 , BX_KEY_F6 },
{ XK_F7 , BX_KEY_F7 },
{ XK_F8 , BX_KEY_F8 },
{ XK_F9 , BX_KEY_F9 },
{ XK_F10 , BX_KEY_F10 },
{ XK_F11 , BX_KEY_F11 },
{ XK_F12 , BX_KEY_F12 },
{ XK_Control_L , BX_KEY_CTRL_L },
{ XK_Shift_L , BX_KEY_SHIFT_L },
{ XK_Shift_R , BX_KEY_SHIFT_R },
{ XK_Caps_Lock , BX_KEY_CAPS_LOCK },
{ XK_Num_Lock , BX_KEY_NUM_LOCK },
{ XK_Alt_L , BX_KEY_ALT_L },
{ XK_Insert , BX_KEY_INSERT },
{ XK_Home , BX_KEY_HOME },
{ XK_End , BX_KEY_END },
{ XK_Page_Up , BX_KEY_PAGE_UP },
{ XK_Page_Down , BX_KEY_PAGE_DOWN }, // end of modified table
{ XK_degree , BX_KEY_GRAVE }, // additional keysyms
{ XK_notsign , BX_KEY_GRAVE },
{ XK_onesuperior , BX_KEY_1 },
{ XK_twosuperior , BX_KEY_2 },
{ XK_section , BX_KEY_3 },
{ XK_threesuperior , BX_KEY_3 },
{ XK_onequarter , BX_KEY_4 },
{ XK_onehalf , BX_KEY_5 },
{ XK_threequarters , BX_KEY_6 },
{ XK_ssharp , BX_KEY_MINUS },
{ XK_acute , BX_KEY_EQUALS },
{ XK_cedilla , BX_KEY_EQUALS },
{ XK_Print , BX_KEY_PRINT },
{ XK_Sys_Req , BX_KEY_PRINT },
{ XK_Scroll_Lock , BX_KEY_SCRL_LOCK },
{ XK_Pause , BX_KEY_PAUSE },
{ XK_Break , BX_KEY_PAUSE },
{ XK_ISO_Left_Tab , BX_KEY_TAB },
{ XK_lstroke , BX_KEY_W },
#ifdef XK_EuroSign
{ XK_EuroSign , BX_KEY_E },
#endif
{ XK_paragraph , BX_KEY_R },
{ XK_tslash , BX_KEY_T },
{ XK_leftarrow , BX_KEY_Y },
{ XK_downarrow , BX_KEY_U },
{ XK_rightarrow , BX_KEY_I },
{ XK_oslash , BX_KEY_O },
{ XK_thorn , BX_KEY_P },
{ XK_udiaeresis , BX_KEY_LEFT_BRACKET },
{ XK_Udiaeresis , BX_KEY_LEFT_BRACKET },
{ XK_diaeresis , BX_KEY_LEFT_BRACKET },
{ XK_ae , BX_KEY_A },
{ XK_eth , BX_KEY_D },
{ XK_dstroke , BX_KEY_F },
{ XK_eng , BX_KEY_G },
{ XK_hstroke , BX_KEY_H },
{ XK_kra , BX_KEY_K },
{ XK_odiaeresis , BX_KEY_SEMICOLON },
{ XK_Odiaeresis , BX_KEY_SEMICOLON },
{ XK_adiaeresis , BX_KEY_SINGLE_QUOTE },
{ XK_Adiaeresis , BX_KEY_SINGLE_QUOTE },
{ XK_guillemotleft , BX_KEY_Z },
{ XK_guillemotright , BX_KEY_X },
{ XK_cent , BX_KEY_C },
{ XK_leftdoublequotemark , BX_KEY_V },
{ XK_rightdoublequotemark, BX_KEY_B },
{ XK_mu , BX_KEY_M },
{ XK_horizconnector , BX_KEY_COMMA },
{ XK_periodcentered , BX_KEY_PERIOD },
{ XK_dead_belowdot , BX_KEY_SLASH },
{ XK_Meta_L , BX_KEY_ALT_L },
{ XK_Mode_switch , BX_KEY_ALT_R },
{ XK_Multi_key , BX_KEY_ALT_R },
{ XK_Control_R , BX_KEY_CTRL_R },
{ XK_Super_L , BX_KEY_WIN_L },
{ XK_Super_R , BX_KEY_WIN_R },
{ XK_Menu , BX_KEY_MENU },
};
extern Bit8u graphics_snapshot[32 * 1024]; extern Bit8u graphics_snapshot[32 * 1024];
@ -1072,11 +510,6 @@ if (bx_options.Oprivate_colormap->get ()) {
BX_PANIC(("vga_x: bits_per_pixel < depth ?")); BX_PANIC(("vga_x: bits_per_pixel < depth ?"));
} }
bx_keymap.addTable("us",&keymap_us,sizeof(keymap_us)/(sizeof(Bit32u)*2));
bx_keymap.addTable("fr",&keymap_fr,sizeof(keymap_fr)/(sizeof(Bit32u)*2));
bx_keymap.addTable("de",&keymap_de,sizeof(keymap_de)/(sizeof(Bit32u)*2));
bx_keymap.addTable("es",&keymap_es,sizeof(keymap_es)/(sizeof(Bit32u)*2));
bx_keymap.setDefault("us");
} }
curr_background = 0; curr_background = 0;
@ -1088,6 +521,11 @@ if (bx_options.Oprivate_colormap->get ()) {
XFlush(bx_x_display); XFlush(bx_x_display);
// loads keymap for x11
if(bx_options.keyboard.OuseMapping->get()) {
bx_keymap.loadKeymap(convertStringToXKeysym);
}
} }
@ -1370,7 +808,6 @@ xkeypress(KeySym keysym, int press_release)
{ {
Bit32u key_event; Bit32u key_event;
/* Old (no mapping) behavior */ /* Old (no mapping) behavior */
if(!bx_options.keyboard.OuseMapping->get()){ if(!bx_options.keyboard.OuseMapping->get()){
@ -1898,6 +1335,22 @@ static void enable_cursor ()
XUndefineCursor(bx_x_display, win); XUndefineCursor(bx_x_display, win);
} }
/* convertStringToXKeysym is a keymap callback
* used when reading the keymap file.
* It converts a Symblic String to a GUI Constant
*
* It returns a Bit32u constant or BX_KEYMAP_UNKNOWN if it fails
*/
static Bit32u convertStringToXKeysym (const char *string)
{
KeySym keysym=XStringToKeysym(string);
// failure, return unknown
if(keysym==NoSymbol) return BX_KEYMAP_UNKNOWN;
return((Bit32u)keysym);
}
#if BX_USE_IDLE_HACK #if BX_USE_IDLE_HACK
/* BX_USE_IDLE_HACK: a small idle hack by /* BX_USE_IDLE_HACK: a small idle hack by

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// $Id: main.cc,v 1.87 2002-03-03 06:10:04 bdenney Exp $ // $Id: main.cc,v 1.88 2002-03-06 09:31:54 cbothamy Exp $
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// //
// Copyright (C) 2001 MandrakeSoft S.A. // Copyright (C) 2001 MandrakeSoft S.A.
@ -815,9 +815,9 @@ void bx_init_options ()
NULL, NULL,
0); 0);
bx_options.keyboard.Okeymap = new bx_param_string_c (BXP_KEYBOARD_MAP, bx_options.keyboard.Okeymap = new bx_param_string_c (BXP_KEYBOARD_MAP,
"Keymap name", "Keymap filename",
NULL, NULL,
"", 10); "", BX_PATHNAME_LEN);
// Keyboard type // Keyboard type
bx_options.Okeyboard_type = new bx_param_enum_c (BXP_KBD_TYPE, bx_options.Okeyboard_type = new bx_param_enum_c (BXP_KBD_TYPE,