keymap.h

Go to the documentation of this file.
00001 /* ES40 emulator.
00002  * Copyright (C) 2007-2008 by the ES40 Emulator Project
00003  *
00004  * WWW    : http://sourceforge.net/projects/es40
00005  * E-mail : camiel@camicom.com
00006  * 
00007  *  This file is based upon Bochs.
00008  *
00009  *  Copyright (C) 2002  MandrakeSoft S.A.
00010  *
00011  *    MandrakeSoft S.A.
00012  *    43, rue d'Aboukir
00013  *    75002 Paris - France
00014  *    http://www.linux-mandrake.com/
00015  *    http://www.mandrakesoft.com/
00016  *
00017  *  This library is free software; you can redistribute it and/or
00018  *  modify it under the terms of the GNU Lesser General Public
00019  *  License as published by the Free Software Foundation; either
00020  *  version 2 of the License, or (at your option) any later version.
00021  *
00022  *  This library is distributed in the hope that it will be useful,
00023  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00024  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00025  *  Lesser General Public License for more details.
00026  *
00027  *  You should have received a copy of the GNU Lesser General Public
00028  *  License along with this library; if not, write to the Free Software
00029  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00030  */
00031 
00058 #include "../Configurator.h"
00059 
00060 // In case of unknown symbol
00061 #define BX_KEYMAP_UNKNOWN 0xFFFFFFFF
00062 
00064 typedef struct
00065 {
00066   u32 baseKey;  // base key
00067   u32 modKey;   // modifier key that must be held down
00068   s32 ascii;    // ascii equivalent, if any
00069   u32 hostKey;  // value that the host's OS or library recognizes
00070 } BXKeyEntry;
00071 
00075 class bx_keymap_c
00076 {
00077   public:
00078     bx_keymap_c(CConfigurator* cfg);
00079     ~             bx_keymap_c(void);
00080 
00081     void          loadKeymap(u32 stringToSymbol (const char*));
00082     void          loadKeymap(u32 stringToSymbol (const char*),
00083                              const char *filename);
00084     bool          isKeymapLoaded();
00085 
00086     BXKeyEntry*   findHostKey(u32 hostkeynum);
00087     BXKeyEntry*   findAsciiChar(u8 ascii);
00088     const char*         getBXKeyName(u32 key);
00089   private:
00090     u32             convertStringToBXKey(const char* );
00091     CConfigurator*  myCfg;
00092 
00093     BXKeyEntry*     keymapTable;
00094     u16             keymapCount;
00095 };
00096 
00097 extern bx_keymap_c*   bx_keymap;

SourceForge.net Logo
Project space on SourceForge.net