ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

keytrans.h
Go to the documentation of this file.
00001 
00002 //                                                               //
00003 //                                                               //
00004 //      Key translations - I.Ioannou (roryt@hol.gr)              //
00005 //          Athens - Greece    December 18, 1996 02:56am         //
00006 //          Reads a .cfg file and keeps the key definitions      //
00007 //                for the WIN32 console telnet                   //
00008 //      modified for alternate keymap swiching                   //
00009 //          by Andrey V. Smilianets (smile@head.aval.kiev.ua)    //
00010 //          Kiev - Ukraine, December 1997.                       //
00012 //                                                               //
00013 //                class KeyTranslator                            //
00014 //                                                               //
00015 //  Load          : loads or replaces the keymap                 //
00016 //  TranslateKey  : returns a char * to the key def              //
00017 //  AddKeyDef     : Changes or adds the key translation          //
00018 //  DeleteKeyDef  : Deletes a key def from the list              //
00020 
00021 #pragma once
00022 
00023 #include "tkeydef.h"
00024 #include "tkeymap.h"
00025 
00026 #define TOKEN_DELIMITERS " +\t" // The word's delimiters
00027 
00028 // Ioannou 2 June 98:  Borland needs them - quick hack
00029 #ifdef __BORLANDC__
00030 #define bool BOOL
00031 #define true TRUE
00032 #define false FALSE
00033 #endif //  __BORLANDC__
00034 
00035 // Maybe not portable, but this is for application cursor mode
00036 // (Paul Brannan 5/27/98)
00037 // Updated for correct precedence in tncon.cpp (Paul Brannan 12/9/98)
00038 #define APP4_KEY            0x8000
00039 #define APP3_KEY            0x4000
00040 #define APP2_KEY            0x2000
00041 #define APP_KEY             0x1000
00042 
00044 //                class KeyTranslator                      //
00045 //  Load          : loads or replaces the keymap           //
00046 //  TranslateKey  : returns a sz to the key def            //
00047 //  AddKeyDef     : Changes or adds the key translation    //
00048 //  DeleteKeyDef  : Deletes a key def from the list        //
00050 
00051 class KeyTranslator {
00052 friend class TMapLoader;            // FIX ME!!  This isn't the best solution
00053 public:
00054     KeyTranslator();
00055     ~KeyTranslator() { DeleteAllDefs(); }
00056 
00057     int  SwitchTo(int);             // switch to selected keymap
00058     int switchMap(TKeyDef& tk);
00059 
00060     // Returns a pointer to the string that should be printed.
00061     // Should return NULL if there is no translation for the key.
00062     const char *TranslateKey(WORD wVirtualKeyCode, DWORD dwControlKeyState);
00063 
00064     // Changes or adds the key translation associated with
00065     // wVirtualScanCode and dwControlKeyState.
00066     // Return 1 on success.
00067     int AddKeyDef(WORD wVirtualKeyCode, DWORD dwControlKeyState, char *lpzKeyDef);
00068     int AddKeyDef(WORD wVirtualKeyCode, DWORD dwControlKeyState, tn_ops op);
00069 
00070     // Delete a key translation
00071     int DeleteKeyDef(WORD wVirtualKeyCode, DWORD dwControlKeyState);
00072 
00073     // Paul Brannan 8/28/98
00074     void set_ext_mode(DWORD mode) {ext_mode |= mode;}
00075     void unset_ext_mode(DWORD mode) {ext_mode &= ~mode;}
00076     void clear_ext_mode() {ext_mode = 0;}
00077     DWORD get_ext_mode() {return ext_mode;}
00078 
00079 private:
00080     DWORD     Fix_ControlKeyState(char *);
00081     char*     Fix_Tok(char *);
00082     DWORD ext_mode;                             // Paul Brannan 8/28/98
00083 
00084     TArrayAsVector<KeyMap> mapArray;
00085     TArrayAsVector<TKeyDef> globals;
00086 
00087     void      DeleteAllDefs(void);
00088     int       AddGlobalDef(WORD wVirtualKeyCode, char*lpzKeyDef);
00089     int       LookOnGlobal(char* vkey);
00090     DWORD     GetGlobalCode(int i) {return globals[i].GetCodeKey();}
00091 
00092     int currentKeyMap, mainKeyMap;              // AVS
00093 
00094 };

Generated on Sat May 26 2012 04:16:11 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.