test: kbdnecat.c Source File

Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

# kbdnecat.c

Go to the documentation of this file.

    00001 #if defined(_PC98_)
    00002 /***************************************************************************\
    00003 * Module Name: kbdnec.c
    00004 *
    00005 * Copyright (c) 1985-92, NEC Corporation
    00006 *
    00007 * History:
    00008 \***************************************************************************/
    00009 #else // defined(_PC98_)
    00010 /***************************************************************************\
    00011 * Module Name: kbd106.c
    00012 *
    00013 * Copyright (c) 1985-92, Microsoft Corporation
    00014 *
    00015 * History:
    00016 \***************************************************************************/
    00017 #endif // defined(_PC98_)
    00018
    00019 #include <windows.h>
    00020 #include <ime.h>
    00021 #include "vkoem.h"
    00022 #include "kbdjpn.h"
    00023 #if defined(_PC98_)
    00024 #include "kbdnecAT.h"
    00025 #else // defined(_PC98_)
    00026 #include "kbd106.h"
    00027 #endif // defined(_PC98_)
    00028
    00029 #if defined(_M_IA64)
    00030 #pragma section(".data")
    00031 #define ALLOC_SECTION_LDATA __declspec(allocate(".data"))
    00032 #else
    00033 #pragma data_seg(".data")
    00034 #define ALLOC_SECTION_LDATA
    00035 #endif
    00036
    00037 #if defined(_PC98_)
    00038 /***************************************************************************\
    00039 * ausVK[] - Virtual Scan Code to Virtual Key conversion table for NEC 106
    00040 \***************************************************************************/
    00041 #else // defined(_PC98_)
    00042 /***************************************************************************\
    00043 * ausVK[] - Virtual Scan Code to Virtual Key conversion table for 106
    00044 \***************************************************************************/
    00045 #endif // defined(_PC98_)
    00046
    00047 static ALLOC_SECTION_LDATA USHORT ausVK[] = {
    00048     T00, T01, T02, T03, T04, T05, T06, T07,
    00049     T08, T09, T0A, T0B, T0C, T0D, T0E, T0F,
    00050     T10, T11, T12, T13, T14, T15, T16, T17,
    00051     T18, T19, T1A, T1B, T1C, T1D, T1E, T1F,
    00052     T20, T21, T22, T23, T24, T25, T26, T27,
    00053     T28,
    00054
    00055     /*
    00056      * Hankaku/Zenkaku/Kanji key must have KBDSPECIAL bit set (NLS key)
    00057      */
    00058     T29 | KBDSPECIAL,
    00059
    00060               T2A, T2B, T2C, T2D, T2E, T2F,
    00061     T30, T31, T32, T33, T34, T35,
    00062
    00063     /*
    00064      * Right-hand Shift key must have KBDEXT bit set.
    00065      */
    00066     T36 | KBDEXT,
    00067
    00068 #if defined(_PC98_)
    00069     T37,
    00070 #else // defined(_PC98_)
    00071     /*
    00072      * numpad_* + Shift/Alt -> SnapShot
    00073      */
    00074     T37 | KBDMULTIVK,
    00075 #endif // defined(_PC98_)
    00076
    00077     T38, T39,
    00078
    00079 #if defined(_PC98_)
    00080     T3A,
    00081 #else // defined(_PC98_)
    00082     /*
    00083      * Alphanumeric/CapsLock key must have KBDSPECIAL bit set (NLS key)
    00084      */
    00085     T3A | KBDSPECIAL,
    00086 #endif // defined(_PC98_)
    00087
    00088                    T3B, T3C, T3D, T3E, T3F,
    00089     T40, T41, T42, T43, T44,
    00090
    00091     /*
    00092      * NumLock Key:
    00093      *     KBDEXT     - VK_NUMLOCK is an Extended key
    00094      *     KBDMULTIVK - VK_NUMLOCK or VK_PAUSE (without or with CTRL)
    00095      */
    00096     T45 | KBDEXT | KBDMULTIVK,
    00097
    00098 #if defined(_PC98_)
    00099     T46,
    00100 #else // defined(_PC98_)
    00101     T46 | KBDMULTIVK,
    00102 #endif // defined(_PC98_)
    00103
    00104     /*
    00105      * Number Pad keys:
    00106      *     KBDNUMPAD  - digits 0-9 and decimal point.
    00107      *     KBDSPECIAL - require special processing by Windows
    00108      */
    00109     T47 | KBDNUMPAD | KBDSPECIAL,   // Numpad 7 (Home)
    00110     T48 | KBDNUMPAD | KBDSPECIAL,   // Numpad 8 (Up),
    00111     T49 | KBDNUMPAD | KBDSPECIAL,   // Numpad 9 (PgUp),
    00112     T4A,
    00113     T4B | KBDNUMPAD | KBDSPECIAL,   // Numpad 4 (Left),
    00114     T4C | KBDNUMPAD | KBDSPECIAL,   // Numpad 5 (Clear),
    00115     T4D | KBDNUMPAD | KBDSPECIAL,   // Numpad 6 (Right),
    00116     T4E,
    00117     T4F | KBDNUMPAD | KBDSPECIAL,   // Numpad 1 (End),
    00118     T50 | KBDNUMPAD | KBDSPECIAL,   // Numpad 2 (Down),
    00119     T51 | KBDNUMPAD | KBDSPECIAL,   // Numpad 3 (PgDn),
    00120     T52 | KBDNUMPAD | KBDSPECIAL,   // Numpad 0 (Ins),
    00121     T53 | KBDNUMPAD | KBDSPECIAL,   // Numpad . (Del),
    00122
    00123 #if defined(_PC98_)
    00124     T54, T55, T56, T57, T58,
    00125     T59 | KBDSPECIAL,               // TenKey EQU (VK_SCROLL)
    00126                                   T5A, T5B,
    00127 #else // defined(_PC98_)
    00128     T54, T55, T56, T57, T58, T59, T5A, T5B,
    00129 #endif // defined(_PC98_)
    00130
    00131     T5C, T5D, T5E, T5F, T60, T61, T62, T63,
    00132     T64, T65, T66, T67, T68, T69, T6A, T6B,
    00133     T6C, T6D, T6E, T6F,
    00134
    00135     /*
    00136      * Hiragana/Katakana/Roman key must have KBDSPECIAL bit set (NLS key)
    00137      */
    00138 #if defined(_PC98_)
    00139     T70,
    00140 #else // defined(_PC98_)
    00141     T70 | KBDSPECIAL,
    00142 #endif // defined(_PC98_)
    00143
    00144                              T71, T72, T73,
    00145     T74, T75, T76, T77, T78,
    00146
    00147     /*
    00148      * Conversion key must have KBDSPECIAL bit set (NLS key)
    00149      */
    00150     T79 | KBDSPECIAL,
    00151
    00152                                   T7A,
    00153
    00154     /*
    00155      * Non-Conversion key must have KBDSPECIAL bit set (NLS key)
    00156      */
    00157     T7B | KBDSPECIAL,
    00158
    00159     T7C, T7D, T7E, T7F
    00160 };
    00161
    00162 static ALLOC_SECTION_LDATA VSC_VK aE0VscToVk[] = {
    00163         { 0x1C, X1C | KBDEXT              },  // Numpad Enter
    00164         { 0x1D, X1D | KBDEXT              },  // RControl
    00165         { 0x35, X35 | KBDEXT              },  // Numpad Divide
    00166         { 0x37, X37 | KBDEXT              },  // Snapshot
    00167         { 0x38, X38 | KBDEXT              },  // RMenu
    00168         { 0x46, X46 | KBDEXT              },  // Break (Ctrl + Pause)
    00169 #if defined(_PC98_)
    00170         { 0x47, X47 | KBDEXT | KBDSPECIAL },  // CLR HOME
    00171 #else // defined(_PC98_)
    00172         { 0x47, X47 | KBDEXT              },  // Home
    00173 #endif // defined(_PC98_)
    00174         { 0x48, X48 | KBDEXT              },  // Up
    00175         { 0x49, X49 | KBDEXT              },  // Prior
    00176         { 0x4B, X4B | KBDEXT              },  // Left
    00177         { 0x4D, X4D | KBDEXT              },  // Right
    00178 #if defined(_PC98_)
    00179         { 0x4F, X4F | KBDEXT | KBDSPECIAL },  // HELP
    00180 #else // defined(_PC98_)
    00181         { 0x4F, X4F | KBDEXT              },  // End
    00182 #endif // defined(_PC98_)
    00183         { 0x50, X50 | KBDEXT              },  // Down
    00184         { 0x51, X51 | KBDEXT              },  // Next
    00185         { 0x52, X52 | KBDEXT              },  // Insert
    00186         { 0x53, X53 | KBDEXT              },  // Delete
    00187         { 0x5B, X5B | KBDEXT              },  // Left Win
    00188         { 0x5C, X5C | KBDEXT              },  // Right Win
    00189         { 0x5D, X5D | KBDEXT              },  // Application
    00190         { 0,      0                       }
    00191 };
    00192
    00193 static ALLOC_SECTION_LDATA VSC_VK aE1VscToVk[] = {
    00194         { 0x1D, Y1D                       },  // Pause
    00195         { 0   ,   0                       }
    00196 };
    00197
    00198 /***************************************************************************\
    00199 * aVkToBits[]  - map Virtual Keys to Modifier Bits
    00200 *
    00201 * See kbd.h for a full description.
    00202 *
    00203 * US Keyboard has only three shifter keys:
    00204 *     SHIFT (L & R) affects alphabnumeric keys,
    00205 *     CTRL  (L & R) is used to generate control characters
    00206 *     ALT   (L & R) used for generating characters by number with numpad
    00207 \***************************************************************************/
    00208
    00209 static ALLOC_SECTION_LDATA VK_TO_BIT aVkToBits[] = {
    00210     { VK_SHIFT,   KBDSHIFT },
    00211     { VK_CONTROL, KBDCTRL  },
    00212     { VK_MENU,    KBDALT   },
    00213     { VK_KANA,    KBDKANA  },
    00214     { 0,          0        }
    00215 };
    00216
    00217 /***************************************************************************\
    00218 * aModification[]  - map character modifier bits to modification number
    00219 *
    00220 * See kbd.h for a full description.
    00221 *
    00222 \***************************************************************************/
    00223
    00224 static ALLOC_SECTION_LDATA MODIFIERS CharModifiers = {
    00225     &aVkToBits[0],
    00226     11,
    00227     {
    00228     //  Modification# //  Keys Pressed  : Explanation
    00229     //  ============= // ============== : =============================
    00230         0,            //                : unshifted characters
    00231         1,            //          SHIFT : capitals, ~!@#$%^&*()_+{}:"<>? etc.
    00232         4,            //     CTRL       : control characters
    00233         6,            //     CTRL SHIFT :
    00234         SHFT_INVALID, // ALT            : invalid
    00235         SHFT_INVALID, // ALT      SHIFT : invalid
    00236         SHFT_INVALID, // ALT CTRL       : invalid
    00237         SHFT_INVALID, // ALT CTRL SHIFT : invalid
    00238         2,            //KANA
    00239         3,            //KANA      SHIFT
    00240         5,            //KANA CTRL
    00241         7             //KANA CTRL SHIFT
    00242     }
    00243 };
    00244
    00245 /***************************************************************************\
    00246 *
    00247 * aVkToWch2[]  - Virtual Key to WCHAR translation for 2 shift states
    00248 * aVkToWch3[]  - Virtual Key to WCHAR translation for 3 shift states
    00249 * aVkToWch4[]  - Virtual Key to WCHAR translation for 4 shift states
    00250 *
    00251 * Table attributes: Unordered Scan, null-terminated
    00252 *
    00253 * Search this table for an entry with a matching Virtual Key to find the
    00254 * corresponding unshifted and shifted WCHAR characters.
    00255 *
    00256 * Reserved VirtualKey values (first column)
    00257 *     -1            - this line contains dead characters (diacritic)
    00258 *     0             - terminator
    00259 *
    00260 * Reserved Attribute values (second column)
    00261 *     CAPLOK        - CapsLock affects this key like Shift
    00262 *     KANALOK       - The KANA-LOCK key affects this key like KANA
    00263 *
    00264 * Reserved character values (third through last column)
    00265 *     WCH_NONE      - No character
    00266 *     WCH_DEAD      - Dead character (diacritic) value is in next line
    00267 *
    00268 \***************************************************************************/
    00269
    00270 static ALLOC_SECTION_LDATA VK_TO_WCHARS4 aVkToWch4[] = {
    00271     //                               |          |   SHIFT  |  KANA  | K+SHFT |
    00272     //                               |          |==========|========|========|
    00273 #if defined(_PC98_)
    00274     {'0'          ,          KANALOK ,'0'       ,'0'       ,WCH_WA  ,WCH_WO  },
    00275 #else // defined(_PC98_)
    00276     {'0'          ,          KANALOK ,'0'       ,WCH_NONE  ,WCH_WA  ,WCH_WO  },
    00277 #endif // defined(_PC98_)
    00278     {'1'          ,          KANALOK ,'1'       ,'!'       ,WCH_NU  ,WCH_NU  },
    00279     {'3'          ,          KANALOK ,'3'       ,'#'       ,WCH_A   ,WCH_AA  },
    00280     {'4'          ,          KANALOK ,'4'       ,'$'       ,WCH_U   ,WCH_UU  },
    00281     {'5'          ,          KANALOK ,'5'       ,'%'       ,WCH_E   ,WCH_EE  },
    00282     {'7'          ,          KANALOK ,'7'       ,0x27      ,WCH_YA  ,WCH_YAA },
    00283     {'8'          ,          KANALOK ,'8'       ,'('       ,WCH_YU  ,WCH_YUU },
    00284     {'9'          ,          KANALOK ,'9'       ,')'       ,WCH_YO  ,WCH_YOO },
    00285     {'A'          , CAPLOK | KANALOK ,'a'       ,'A'       ,WCH_TI  ,WCH_TI  },
    00286     {'B'          , CAPLOK | KANALOK ,'b'       ,'B'       ,WCH_KO  ,WCH_KO  },
    00287     {'C'          , CAPLOK | KANALOK ,'c'       ,'C'       ,WCH_SO  ,WCH_SO  },
    00288     {'D'          , CAPLOK | KANALOK ,'d'       ,'D'       ,WCH_SI  ,WCH_SI  },
    00289     {'E'          , CAPLOK | KANALOK ,'e'       ,'E'       ,WCH_I   ,WCH_II  },
    00290     {'F'          , CAPLOK | KANALOK ,'f'       ,'F'       ,WCH_HA  ,WCH_HA  },
    00291     {'G'          , CAPLOK | KANALOK ,'g'       ,'G'       ,WCH_KI  ,WCH_KI  },
    00292     {'H'          , CAPLOK | KANALOK ,'h'       ,'H'       ,WCH_KU  ,WCH_KU  },
    00293     {'I'          , CAPLOK | KANALOK ,'i'       ,'I'       ,WCH_NI  ,WCH_NI  },
    00294     {'J'          , CAPLOK | KANALOK ,'j'       ,'J'       ,WCH_MA  ,WCH_MA  },
    00295     {'K'          , CAPLOK | KANALOK ,'k'       ,'K'       ,WCH_NO  ,WCH_NO  },
    00296     {'L'          , CAPLOK | KANALOK ,'l'       ,'L'       ,WCH_RI  ,WCH_RI  },
    00297     {'M'          , CAPLOK | KANALOK ,'m'       ,'M'       ,WCH_MO  ,WCH_MO  },
    00298     {'N'          , CAPLOK | KANALOK ,'n'       ,'N'       ,WCH_MI  ,WCH_MI  },
    00299     {'O'          , CAPLOK | KANALOK ,'o'       ,'O'       ,WCH_RA  ,WCH_RA  },
    00300     {'P'          , CAPLOK | KANALOK ,'p'       ,'P'       ,WCH_SE  ,WCH_SE  },
    00301     {'Q'          , CAPLOK | KANALOK ,'q'       ,'Q'       ,WCH_TA  ,WCH_TA  },
    00302     {'R'          , CAPLOK | KANALOK ,'r'       ,'R'       ,WCH_SU  ,WCH_SU  },
    00303     {'S'          , CAPLOK | KANALOK ,'s'       ,'S'       ,WCH_TO  ,WCH_TO  },
    00304     {'T'          , CAPLOK | KANALOK ,'t'       ,'T'       ,WCH_KA  ,WCH_KA  },
    00305     {'U'          , CAPLOK | KANALOK ,'u'       ,'U'       ,WCH_NA  ,WCH_NA  },
    00306     {'V'          , CAPLOK | KANALOK ,'v'       ,'V'       ,WCH_HI  ,WCH_HI  },
    00307     {'W'          , CAPLOK | KANALOK ,'w'       ,'W'       ,WCH_TE  ,WCH_TE  },
    00308     {'X'          , CAPLOK | KANALOK ,'x'       ,'X'       ,WCH_SA  ,WCH_SA  },
    00309     {'Y'          , CAPLOK | KANALOK ,'y'       ,'Y'       ,WCH_NN  ,WCH_NN  },
    00310     {'Z'          , CAPLOK | KANALOK ,'z'       ,'Z'       ,WCH_TU  ,WCH_TUU },
    00311     {VK_OEM_1     ,          KANALOK ,':'       ,'*'       ,WCH_KE  ,WCH_KE  },
    00312     {VK_OEM_2     ,          KANALOK ,'/'       ,'?'       ,WCH_ME  ,WCH_MD  },
    00313 #if defined(_PC98_)
    00314 #else // defined(_PC98_)
    00315     {VK_OEM_3     ,          KANALOK ,'@'       ,'`'       ,WCH_VS  ,WCH_VS  },
    00316     {VK_OEM_7     ,          KANALOK ,'^'       ,'~'       ,WCH_HE  ,WCH_HE  },
    00317     {VK_OEM_8     , 0                ,WCH_NONE  ,WCH_NONE  ,WCH_NONE,WCH_NONE},
    00318 #endif // defined(_PC98_)
    00319     {VK_OEM_COMMA ,          KANALOK ,','       ,'<'       ,WCH_NE  ,WCH_IC  },
    00320     {VK_OEM_PERIOD,          KANALOK ,'.'       ,'>'       ,WCH_RU  ,WCH_IP  },
    00321     {VK_OEM_PLUS  ,          KANALOK ,';'       ,'+'       ,WCH_RE  ,WCH_RE  },
    00322     {VK_TAB       , 0                ,'\t'      ,'\t'      ,'\t'    ,'\t'    },
    00323     {VK_ADD       , 0                ,'+'       ,'+'       ,'+'     ,'+'     },
    00324     {VK_DECIMAL   , 0                ,'.'       ,'.'       ,'.'     ,'.'     },
    00325     {VK_DIVIDE    , 0                ,'/'       ,'/'       ,'/'     ,'/'     },
    00326     {VK_MULTIPLY  , 0                ,'*'       ,'*'       ,'*'     ,'*'     },
    00327     {VK_SUBTRACT  , 0                ,'-'       ,'-'       ,'-'     ,'-'     },
    00328 #if defined(_PC98_)
    00329     {VK_SEPARATOR , 0                ,','       ,','       ,','     ,','     },
    00330     {VK_OEM_NEC_EQUAL,    0          ,'='       ,'='       ,'='     ,'='     },
    00331 #endif // defined(_PC98_)
    00332     {0            , 0                ,0         ,0         ,0       ,0       }
    00333 };
    00334
    00335 static ALLOC_SECTION_LDATA VK_TO_WCHARS6 aVkToWch6[] = {
    00336     //                      |          |   SHIFT  |  KANA  | K+SHFT |  CONTROL  |  K+CTRL   |
    00337     //                      |          |==========|========|========|===========|===========|
    00338     {VK_BACK      , 0       ,'\b'      ,'\b'      ,'\b'    ,'\b'    , 0x7f      , 0x7f      },
    00339     {VK_CANCEL    , 0       ,0x03      ,0x03      ,0x03    ,0x03    , 0x03      , 0x03      },
    00340     {VK_ESCAPE    , 0       ,0x1b      ,0x1b      ,0x1b    ,0x1b    , 0x1b      , 0x1b      },
    00341 #if defined(_PC98_)
    00342     {VK_OEM_3     , KANALOK ,'@'       ,'~'       ,WCH_VS  ,WCH_VS  , 0x00      , 0x00      },
    00343     {VK_OEM_4     , KANALOK ,'['       ,'{'       ,WCH_SVS ,WCH_OB  , 0x1b      , 0x1b      },
    00344     {VK_OEM_5     , KANALOK ,'\\'      ,'|'       ,WCH_PS  ,WCH_PS  , 0x1c      , 0x1c      },
    00345     {VK_OEM_6     , KANALOK ,']'       ,'}'       ,WCH_MU  ,WCH_CB  , 0x1d      , 0x1d      },
    00346     {VK_OEM_7     , KANALOK ,'^'       ,'`'       ,WCH_HE  ,WCH_HE  , 0x1e      , 0x1e      },
    00347     {VK_OEM_8     , KANALOK ,WCH_NONE  ,'_'       ,WCH_RO  ,WCH_RO  , 0x1f      , 0x1f      },
    00348 #else // defined(_PC98_)
    00349     {VK_OEM_4     , KANALOK ,'['       ,'{'       ,WCH_SVS ,WCH_OB  , 0x1b      , 0x1b      },
    00350     {VK_OEM_5     , KANALOK ,'\\'      ,'|'       ,WCH_PS  ,WCH_PS  , 0x1c      , 0x1c      },
    00351     {VK_OEM_102   , KANALOK ,'\\'      ,'_'       ,WCH_RO  ,WCH_RO  , 0x1c      , 0x1c      },
    00352     {VK_OEM_6     , KANALOK ,']'       ,'}'       ,WCH_MU  ,WCH_CB  , 0x1d      , 0x1d      },
    00353 #endif // defined(_PC98_)
    00354     {VK_RETURN    , 0       ,'\r'      ,'\r'      ,'\r'    ,'\r'    , '\n'      , '\n'      },
    00355     {VK_SPACE     , 0       ,' '       ,' '       ,' '     ,' '     , 0x20      , 0x20      },
    00356     {0            , 0       ,0         ,0         ,0       ,0       , 0         , 0         }
    00357 };
    00358
    00359 static ALLOC_SECTION_LDATA VK_TO_WCHARS8 aVkToWch8[] = {
    00360     //                      |          |   SHIFT  |  KANA  | K+SHFT |  CONTROL  |  K+CTRL   | SHFT+CTRL |K+SHFT+CTRL|
    00361     //                      |          |==========|========|========|===========|===========|===========|===========|
    00362     {'2'          , KANALOK ,'2'       ,'"'       ,WCH_HU  ,WCH_HU  , WCH_NONE  , WCH_NONE  , 0x00      , 0x00      },
    00363     {'6'          , KANALOK ,'6'       ,'&'       ,WCH_O   ,WCH_OO  , WCH_NONE  , WCH_NONE  , 0x1e      , 0x1e      },
    00364     {VK_OEM_MINUS , KANALOK ,'-'       ,'='       ,WCH_HO  ,WCH_HO  , WCH_NONE  , WCH_NONE  , 0x1f      , 0x1f      },
    00365     {0            , 0       ,0         ,0         ,0       ,0       , 0         , 0         , 0         , 0         }
    00366 };
    00367
    00368 // Put this last so that VkKeyScan interprets number characters
    00369 // as coming from the main section of the kbd (aVkToWch2 and
    00370 // aVkToWch4) before considering the numpad (aVkToWch1).
    00371
    00372 static ALLOC_SECTION_LDATA VK_TO_WCHARS4 aVkToWch1[] = {
    00373     //                     |          |   SHIFT  |  KANA  | K+SHFT |
    00374     //                     |          |==========|========|========|
    00375     { VK_NUMPAD0   , 0      ,  '0'    , WCH_NONE ,   '0'  ,WCH_NONE},
    00376     { VK_NUMPAD1   , 0      ,  '1'    , WCH_NONE ,   '1'  ,WCH_NONE},
    00377     { VK_NUMPAD2   , 0      ,  '2'    , WCH_NONE ,   '2'  ,WCH_NONE},
    00378     { VK_NUMPAD3   , 0      ,  '3'    , WCH_NONE ,   '3'  ,WCH_NONE},
    00379     { VK_NUMPAD4   , 0      ,  '4'    , WCH_NONE ,   '4'  ,WCH_NONE},
    00380     { VK_NUMPAD5   , 0      ,  '5'    , WCH_NONE ,   '5'  ,WCH_NONE},
    00381     { VK_NUMPAD6   , 0      ,  '6'    , WCH_NONE ,   '6'  ,WCH_NONE},
    00382     { VK_NUMPAD7   , 0      ,  '7'    , WCH_NONE ,   '7'  ,WCH_NONE},
    00383     { VK_NUMPAD8   , 0      ,  '8'    , WCH_NONE ,   '8'  ,WCH_NONE},
    00384     { VK_NUMPAD9   , 0      ,  '9'    , WCH_NONE ,   '9'  ,WCH_NONE},
    00385     { 0            , 0      ,  '\0'   , 0        ,   0    ,0       }   //null terminator
    00386 };
    00387
    00388 /***************************************************************************\
    00389 * aVkToWcharTable: table of pointers to Character Tables
    00390 *
    00391 * Describes the character tables and the order they should be searched.
    00392 *
    00393 * Note: the order determines the behavior of VkKeyScan() : this function
    00394 *       takes a character and attempts to find a Virtual Key and character-
    00395 *       modifier key combination that produces that character.  The table
    00396 *       containing the numeric keypad (aVkToWch1) must appear last so that
    00397 *       VkKeyScan('0') will be interpreted as one of keys from the main
    00398 *       section, not the numpad.  etc.
    00399 \***************************************************************************/
    00400
    00401 static ALLOC_SECTION_LDATA VK_TO_WCHAR_TABLE aVkToWcharTable[] = {
    00402     {  (PVK_TO_WCHARS1)aVkToWch6, 6, sizeof(aVkToWch6[0]) },
    00403     {  (PVK_TO_WCHARS1)aVkToWch8, 8, sizeof(aVkToWch8[0]) },
    00404     {  (PVK_TO_WCHARS1)aVkToWch4, 4, sizeof(aVkToWch4[0]) },
    00405     {  (PVK_TO_WCHARS1)aVkToWch1, 4, sizeof(aVkToWch1[0]) },  // must come last
    00406     {                       NULL, 0, 0                    }
    00407 };
    00408
    00409 /***************************************************************************\
    00410 * aKeyNames[], aKeyNamesExt[]  - Scan Code -> Key Name tables
    00411 *
    00412 * For the GetKeyNameText() API function
    00413 *
    00414 * Tables for non-extended and extended (KBDEXT) keys.
    00415 * (Keys producing printable characters are named by the character itself)
    00416 \***************************************************************************/
    00417
    00418 static ALLOC_SECTION_LDATA VSC_LPWSTR aKeyNames[] = {
    00419 #if defined(_PC98_)
    00420     0x01,    L"ESC",            // Esc
    00421     0x0e,    L"BS",             // Backspace
    00422     0x0f,    L"TAB",            // Tab
    00423     0x1c,    L"RETURN",         // Enter
    00424     0x1d,    L"CTRL",           // Ctrl
    00425     0x29,    (LPWSTR)SZ_KEY_NAME_HANKAKU_ZENKAKU,  // NLS Key
    00426     0x2a,    L"SHIFT",          // Shift
    00427     0x36,    L"SHIFT",          // Rgiht Shift
    00428 #else // defined(_PC98_)
    00429     0x01,    L"Esc",
    00430     0x0e,    L"Backspace",
    00431     0x0f,    L"Tab",
    00432     0x1c,    L"Enter",
    00433     0x1d,    L"Ctrl",
    00434     0x29,    (LPWSTR)SZ_KEY_NAME_HANKAKU_ZENKAKU,  // NLS Key
    00435     0x2a,    L"Shift",
    00436     0x36,    L"Right Shift",
    00437 #endif // defined(_PC98_)
    00438     0x37,    L"Num *",
    00439 #if defined(_PC98_)
    00440     0x38,    L"GRPH",                   // Alt
    00441     0x39,    L"SPACE",                  // Space
    00442     0x3a,    L"CAPS",                   // Caps Lock
    00443     0x3b,    (LPWSTR)SZ_KEY_NAME_F1,    // F1
    00444     0x3c,    (LPWSTR)SZ_KEY_NAME_F2,    // F2
    00445     0x3d,    (LPWSTR)SZ_KEY_NAME_F3,    // F3
    00446     0x3e,    (LPWSTR)SZ_KEY_NAME_F4,    // F4
    00447     0x3f,    (LPWSTR)SZ_KEY_NAME_F5,    // F5
    00448     0x40,    (LPWSTR)SZ_KEY_NAME_F6,    // F6
    00449     0x41,    (LPWSTR)SZ_KEY_NAME_F7,    // F7
    00450     0x42,    (LPWSTR)SZ_KEY_NAME_F8,    // F8
    00451     0x43,    (LPWSTR)SZ_KEY_NAME_F9,    // F9
    00452     0x44,    (LPWSTR)SZ_KEY_NAME_F10,   // F10
    00453 #else // defined(_PC98_)
    00454     0x38,    L"Alt",
    00455     0x39,    L"Space",
    00456     0x3a,    L"Caps Lock",
    00457     0x3b,    L"F1",
    00458     0x3c,    L"F2",
    00459     0x3d,    L"F3",
    00460     0x3e,    L"F4",
    00461     0x3f,    L"F5",
    00462     0x40,    L"F6",
    00463     0x41,    L"F7",
    00464     0x42,    L"F8",
    00465     0x43,    L"F9",
    00466     0x44,    L"F10",
    00467 #endif // defined(_PC98_)
    00468     0x45,    L"Pause",
    00469     0x46,    L"Scroll Lock",
    00470     0x47,    L"Num 7",
    00471     0x48,    L"Num 8",
    00472     0x49,    L"Num 9",
    00473     0x4a,    L"Num -",
    00474     0x4b,    L"Num 4",
    00475     0x4c,    L"Num 5",
    00476     0x4d,    L"Num 6",
    00477     0x4e,    L"Num +",
    00478     0x4f,    L"Num 1",
    00479     0x50,    L"Num 2",
    00480     0x51,    L"Num 3",
    00481     0x52,    L"Num 0",
    00482 #if defined(_PC98_)
    00483     0x53,    L"Num .",
    00484 #else // defined(_PC98_)
    00485     0x53,    L"Num Del",
    00486 #endif // defined(_PC98_)
    00487     0x54,    L"Sys Req",
    00488 #if defined(_PC98_)
    00489 //    0x55,    L"",
    00490     0x57,    (LPWSTR)SZ_KEY_NAME_F11,     // vf1
    00491     0x58,    (LPWSTR)SZ_KEY_NAME_F12,     // vf2
    00492     0x59,    L"Num =",
    00493 //    0x5B,    L"Convert",                  // not use
    00494     0x5C,    L"Num ,",
    00495     0x5D,    (LPWSTR)SZ_KEY_NAME_F13,     // vf3
    00496     0x5E,    (LPWSTR)SZ_KEY_NAME_F14,     // vf4
    00497     0x5F,    (LPWSTR)SZ_KEY_NAME_F15,     // vf5
    00498     0x70,    (LPWSTR)SZ_KEY_NAME_KANA,    // NLS Key Katakana
    00499     0x79,    L"XFER",                     // NLS Key SZ_KEY_NAME_HIRAGANA
    00500     0x7b,    L"NFER",                     //
    00501 #else // defined(_PC98_)
    00502     0x57,    L"F11",
    00503     0x58,    L"F12",
    00504     0x70,    (LPWSTR)SZ_KEY_NAME_HIRAGANA,
    00505     0x79,    (LPWSTR)SZ_KEY_NAME_HENKAN,
    00506     0x7b,    (LPWSTR)SZ_KEY_NAME_MUHENKAN,
    00507     0x7C,    L"F13",
    00508 #endif // defined(_PC98_)
    00509     0   ,    NULL
    00510 };
    00511
    00512 static ALLOC_SECTION_LDATA VSC_LPWSTR aKeyNamesExt[] = {
    00513 #if defined(_PC98_)
    00514     0x1c,    L"Num Enter",
    00515     0x35,    L"Num /",
    00516     0x37,    L"COPY",                   // Prnt Scr
    00517     0x45,    L"Num Lock",
    00518     0x46,    L"STOP",                   // Break
    00519     0x47,    L"CLR",                    // Home
    00520     0x48,    L"UP",                     // Up
    00521     0x49,    L"ROLL DOWN",              // Page Up
    00522     0x4b,    L"LEFT",                   // Left
    00523     0x4d,    L"RIGHT",                  // Right
    00524     0x4f,    L"HELP",                   // End
    00525     0x50,    L"DOWN",                   // Down
    00526     0x51,    L"ROLL UP",                // Page Down
    00527     0x52,    L"INS",                    // Insert
    00528     0x53,    L"DEL",                    // Delete
    00529     0x54,    L"<00>",
    00530     0x56,    L"HELP",                   // Help
    00531 //  0x5C,    L"CLR",                    // Clear
    00532 #else // defined(_PC98_)
    00533     0x1c,    L"Num Enter",
    00534     0x1d,    L"Right Control",
    00535     0x35,    L"Num /",
    00536     0x37,    L"Prnt Scrn",
    00537     0x38,    L"Right Alt",
    00538     0x45,    L"Num Lock",
    00539     0x46,    L"Break",
    00540     0x47,    L"Home",
    00541     0x48,    L"Up",
    00542     0x49,    L"Page Up",
    00543     0x4b,    L"Left",
    00544     0x4d,    L"Right",
    00545     0x4f,    L"End",
    00546     0x50,    L"Down",
    00547     0x51,    L"Page Down",
    00548     0x52,    L"Insert",
    00549     0x53,    L"Delete",
    00550 #endif // defined(_PC98_)
    00551     0x5B,    L"Left Windows",
    00552     0x5C,    L"Right Windows",
    00553     0x5D,    L"Application",
    00554     0   ,    NULL
    00555 };
    00556
    00557 static ALLOC_SECTION_LDATA KBDTABLES KbdTables = {
    00558     /*
    00559      * Modifier keys
    00560      */
    00561     &CharModifiers,
    00562
    00563     /*
    00564      * Characters tables
    00565      */
    00566     aVkToWcharTable,
    00567
    00568     /*
    00569      * Diacritics  (none for US English)
    00570      */
    00571     NULL,
    00572
    00573     /*
    00574      * Names of Keys  (no dead keys)
    00575      */
    00576     aKeyNames,
    00577     aKeyNamesExt,
    00578     NULL,
    00579
    00580     /*
    00581      * Scan codes to Virtual Keys
    00582      */
    00583     ausVK,
    00584     sizeof(ausVK) / sizeof(ausVK[0]),
    00585     aE0VscToVk,
    00586     aE1VscToVk,
    00587
    00588     /*
    00589      * No Locale-specific special processing
    00590      */
    00591     0
    00592 };
    00593
    00594 PKBDTABLES KbdLayerDescriptor(VOID)
    00595 {
    00596     return &KbdTables;
    00597 }
    00598
    00599 /***********************************************************************\
    00600 * VkToFuncTable_106[]
    00601 *
    00602 \***********************************************************************/
    00603
    00604 static ALLOC_SECTION_LDATA VK_F VkToFuncTable_106[] = {
    00605     {
    00606         VK_DBE_ALPHANUMERIC,  // Base Vk
    00607         KBDNLS_TYPE_TOGGLE,   // NLSFEProcType
    00608         KBDNLS_INDEX_NORMAL,  // NLSFEProcCurrent
    00609         0x02, /* 00000010 */  // NLSFEProcSwitch
    00610         {                     // NLSFEProc
    00611             {KBDNLS_ALPHANUM,0},               // Base
    00612             {KBDNLS_SEND_PARAM_VK,VK_CAPITAL}, // Shift
    00613             {KBDNLS_ALPHANUM,0},               // Control
    00614             {KBDNLS_ALPHANUM,0},               // Shift+Control
    00615             {KBDNLS_ALPHANUM,0},               // Alt
    00616             {KBDNLS_ALPHANUM,0},               // Shift+Alt
    00617             {KBDNLS_CODEINPUT,0},              // Control+Alt
    00618             {KBDNLS_CODEINPUT,0}               // Shift+Control+Alt
    00619         },
    00620         {                     // NLSFEProcAlt
    00621             {KBDNLS_SEND_PARAM_VK,VK_CAPITAL}, // Base
    00622             {KBDNLS_SEND_PARAM_VK,VK_CAPITAL}, // Shift
    00623             {KBDNLS_NOEVENT,0},                // Control
    00624             {KBDNLS_NOEVENT,0},                // Shift+Control
    00625             {KBDNLS_NOEVENT,0},                // Alt
    00626             {KBDNLS_NOEVENT,0},                // Shift+Alt
    00627             {KBDNLS_NOEVENT,0},                // Control+Alt
    00628             {KBDNLS_NOEVENT,0}                 // Shift+Control+Alt
    00629         }
    00630     },
    00631     {
    00632         VK_DBE_HIRAGANA,     // Base Vk
    00633         KBDNLS_TYPE_TOGGLE,  // NLSFEProcType
    00634         KBDNLS_INDEX_NORMAL, // NLSFEProcCurrent
    00635         0x08, /* 00001000 */ // NLSFEProcSwitch
    00636         {                    // NLSFEProc
    00637             {KBDNLS_HIRAGANA,0},             // Base
    00638             {KBDNLS_KATAKANA,0},             // Shift
    00639             {KBDNLS_HIRAGANA,0},             // Control
    00640             {KBDNLS_SEND_PARAM_VK,VK_KANA},  // Shift+Control
    00641             {KBDNLS_ROMAN,0},                // Alt
    00642             {KBDNLS_ROMAN,0},                // Shift+Alt
    00643             {KBDNLS_ROMAN,0},                // Control+Alt
    00644             {KBDNLS_NOEVENT,0}               // Shift+Control+Alt
    00645         },
    00646         {                    // NLSFEProcIndexAlt
    00647             {KBDNLS_SEND_PARAM_VK,VK_KANA},  // Base
    00648             {KBDNLS_SEND_PARAM_VK,VK_KANA},  // Shift
    00649             {KBDNLS_SEND_PARAM_VK,VK_KANA},  // Control
    00650             {KBDNLS_SEND_PARAM_VK,VK_KANA},  // Shift+Control
    00651             {KBDNLS_NOEVENT,0},              // Alt
    00652             {KBDNLS_NOEVENT,0},              // Shift+Alt
    00653             {KBDNLS_NOEVENT,0},              // Control+Alt
    00654             {KBDNLS_NOEVENT,0}               // Shift+Control+Alt
    00655         }
    00656     },
    00657     {
    00658         VK_DBE_SBCSCHAR,     // Base Vk
    00659         KBDNLS_TYPE_NORMAL,  // NLSFEProcType
    00660         KBDNLS_INDEX_NORMAL, // NLSFEProcCurrent
    00661         0x0,                 // NLSFEProcSwitch
    00662         {                    // NLSFEProc
    00663             {KBDNLS_SBCSDBCS,0},             // Base
    00664             {KBDNLS_SBCSDBCS,0},             // Shift
    00665             {KBDNLS_SBCSDBCS,0},             // Control
    00666             {KBDNLS_SBCSDBCS,0},             // Shift+Control
    00667             {KBDNLS_SEND_PARAM_VK,VK_KANJI}, // Alt
    00668             {KBDNLS_SBCSDBCS,0},             // Shift+Alt
    00669             {KBDNLS_SEND_PARAM_VK,VK_DBE_ENTERIMECONFIGMODE}, // Control+Alt
    00670             {KBDNLS_SEND_PARAM_VK,VK_DBE_ENTERIMECONFIGMODE}  // Shift+Control+Alt
    00671         },
    00672         {                    // NLSFEProcIndexAlt
    00673             {KBDNLS_NULL,0},  // Base
    00674             {KBDNLS_NULL,0},  // Shift
    00675             {KBDNLS_NULL,0},  // Control
    00676             {KBDNLS_NULL,0},  // Shift+Control
    00677             {KBDNLS_NULL,0},  // Alt
    00678             {KBDNLS_NULL,0},  // Shift+Alt
    00679             {KBDNLS_NULL,0},  // Control+Alt
    00680             {KBDNLS_NULL,0}   // Shift+Control+Alt
    00681         }
    00682     },
    00683     {
    00684         VK_NONCONVERT,       // Base Vk
    00685         KBDNLS_TYPE_NORMAL,  // NLSFEProcType
    00686         KBDNLS_INDEX_NORMAL, // NLSFEProcCurrent
    00687         0x0,                 // NLSFEProcSwitch
    00688         {                    // NLSFEProc
    00689             {KBDNLS_SEND_BASE_VK,0},         // Base
    00690             {KBDNLS_SEND_BASE_VK,0},         // Shift
    00691             {KBDNLS_SEND_BASE_VK,0},         // Control
    00692             {KBDNLS_SEND_BASE_VK,0},         // Shift+Control
    00693             {KBDNLS_SEND_BASE_VK,0},         // Alt
    00694             {KBDNLS_SEND_BASE_VK,0},         // Shift+Alt
    00695             {KBDNLS_SEND_PARAM_VK,VK_DBE_ENTERWORDREGISTERMODE}, // Control+Alt
    00696             {KBDNLS_SEND_PARAM_VK,VK_DBE_ENTERWORDREGISTERMODE}  // Shift+Control+Alt
    00697         },
    00698         {                         // NLSFEProcIndexAlt
    00699             {KBDNLS_NULL,0},  // Base
    00700             {KBDNLS_NULL,0},  // Shift
    00701             {KBDNLS_NULL,0},  // Control
    00702             {KBDNLS_NULL,0},  // Shift+Control
    00703             {KBDNLS_NULL,0},  // Alt
    00704             {KBDNLS_NULL,0},  // Shift+Alt
    00705             {KBDNLS_NULL,0},  // Control+Alt
    00706             {KBDNLS_NULL,0}   // Shift+Control+Alt
    00707         }
    00708     }
    00709 };
    00710
    00711 #if defined(_PC98_)
    00712 static ALLOC_SECTION_LDATA VK_F VkToFuncTable_NEC[] = {
    00713     {
    00714         VK_DBE_SBCSCHAR,     // Base Vk
    00715         KBDNLS_TYPE_NORMAL,  // NLSFEProcType
    00716         KBDNLS_INDEX_NORMAL, // NLSFEProcCurrent
    00717         0x0,                 // NLSFEProcSwitch
    00718         {                    // NLSFEProc
    00719             {KBDNLS_SBCSDBCS,0},             // Base
    00720             {KBDNLS_SBCSDBCS,0},             // Shift
    00721             {KBDNLS_SBCSDBCS,0},             // Control
    00722             {KBDNLS_SBCSDBCS,0},             // Shift+Control
    00723             {KBDNLS_SBCSDBCS,0},             // Alt
    00724 //            {KBDNLS_SEND_PARAM_VK,VK_KANJI}, // Alt
    00725             {KBDNLS_SBCSDBCS,0},             // Shift+Alt
    00726             {KBDNLS_SEND_PARAM_VK,VK_DBE_ENTERIMECONFIGMODE}, // Control+Alt
    00727             {KBDNLS_SEND_PARAM_VK,VK_DBE_ENTERIMECONFIGMODE}  // Shift+Control+Alt
    00728         },
    00729         {                    // NLSFEProcIndexAlt
    00730             {KBDNLS_NULL,0},  // Base
    00731             {KBDNLS_NULL,0},  // Shift
    00732             {KBDNLS_NULL,0},  // Control
    00733             {KBDNLS_NULL,0},  // Shift+Control
    00734             {KBDNLS_NULL,0},  // Alt
    00735             {KBDNLS_NULL,0},  // Shift+Alt
    00736             {KBDNLS_NULL,0},  // Control+Alt
    00737             {KBDNLS_NULL,0}   // Shift+Control+Alt
    00738         }
    00739     },
    00740     {
    00741         VK_NONCONVERT,       // Base Vk  PC98_NFER key
    00742         KBDNLS_TYPE_NORMAL,  // NLSFEProcType
    00743         KBDNLS_INDEX_NORMAL, // NLSFEProcCurrent
    00744         0x0,                 // NLSFEProcSwitch
    00745         {                    // NLSFEProc
    00746             {KBDNLS_SEND_BASE_VK,0},                             // Base
    00747             {KBDNLS_SEND_BASE_VK,0},                             // Shift
    00748             {KBDNLS_SEND_PARAM_VK,VK_DBE_ALPHANUMERIC},          // Control
    00749             {KBDNLS_SBCSDBCS,0},                                 // Shift+Control
    00750             {KBDNLS_SEND_PARAM_VK,VK_DBE_KATAKANA},              // Alt
    00751             {KBDNLS_SEND_PARAM_VK,VK_DBE_ENTERWORDREGISTERMODE}, // Shift+Alt
    00752             {KBDNLS_SEND_PARAM_VK,VK_DBE_NOCODEINPUT},           // Control+Alt
    00753             {KBDNLS_SEND_PARAM_VK,VK_DBE_FLUSHSTRING}            // Shift+Control+Alt
    00754         },
    00755         {                     // NLSFEProcIndexAlt
    00756             {KBDNLS_NULL,0},  // Base
    00757             {KBDNLS_NULL,0},  // Shift
    00758             {KBDNLS_NULL,0},  // Control
    00759             {KBDNLS_NULL,0},  // Shift+Control
    00760             {KBDNLS_NULL,0},  // Alt
    00761             {KBDNLS_NULL,0},  // Shift+Alt
    00762             {KBDNLS_NULL,0},  // Control+Alt
    00763             {KBDNLS_NULL,0}   // Shift+Control+Alt
    00764         }
    00765     },
    00766     {
    00767         VK_CONVERT,            // Base Vk  PC98_XFER key
    00768         KBDNLS_TYPE_NORMAL,  // NLSFEProcType
    00769         KBDNLS_INDEX_NORMAL, // NLSFEProcCurrent
    00770         0x0,                 // NLSFEProcSwitch
    00771         {                    // NLSFEProc
    00772             {KBDNLS_SEND_BASE_VK,0},                          // Base
    00773             {KBDNLS_SEND_BASE_VK,0},                          // Shift
    00774             {KBDNLS_SEND_PARAM_VK,VK_KANJI},                  // Control
    00775             {KBDNLS_SEND_BASE_VK,0},                          // Shift+Control
    00776             {KBDNLS_ROMAN,0},                                 // Alt
    00777             {KBDNLS_SEND_PARAM_VK,VK_DBE_ENTERIMECONFIGMODE}, // Shift+Alt
    00778             {KBDNLS_SEND_PARAM_VK,VK_DBE_CODEINPUT},          // Control+Alt
    00779             {KBDNLS_SEND_PARAM_VK,VK_DBE_HIRAGANA}            // Shift+Control+Alt
    00780         },
    00781         {                     // NLSFEProcIndexAlt
    00782             {KBDNLS_NULL,0},  // Base
    00783             {KBDNLS_NULL,0},  // Shift
    00784             {KBDNLS_NULL,0},  // Control
    00785             {KBDNLS_NULL,0},  // Shift+Control
    00786             {KBDNLS_NULL,0},  // Alt
    00787             {KBDNLS_NULL,0},  // Shift+Alt
    00788             {KBDNLS_NULL,0},  // Control+Alt
    00789             {KBDNLS_NULL,0}   // Shift+Control+Alt
    00790         }
    00791     },
    00792     {
    00793         VK_OEM_NEC_EQUAL,    // Base Vk NEC98_"="  key
    00794         KBDNLS_TYPE_NORMAL,  // NLSFEProcType
    00795         KBDNLS_INDEX_NORMAL, // NLSFEProcCurrent
    00796         0x0,                 // NLSFEProcSwitch
    00797         {                    // NLSFEProc
    00798             {KBDNLS_SEND_BASE_VK,0},                  // Base
    00799             {KBDNLS_SEND_BASE_VK,0},                  // Shift
    00800             {KBDNLS_SEND_PARAM_VK,VK_SCROLL},         // Control
    00801             {KBDNLS_SEND_BASE_VK,0},                  // Shift+Control
    00802             {KBDNLS_SEND_BASE_VK,0},                  // Alt
    00803             {KBDNLS_SEND_BASE_VK,0},                  // Shift+Alt
    00804             {KBDNLS_SEND_BASE_VK,0},                  // Control+Alt
    00805             {KBDNLS_SEND_BASE_VK,0}                   // Shift+Control+Alt
    00806         },
    00807         {                     // NLSFEProcIndexAlt
    00808             {KBDNLS_NULL,0},  // Base
    00809             {KBDNLS_NULL,0},  // Shift
    00810             {KBDNLS_NULL,0},  // Control
    00811             {KBDNLS_NULL,0},  // Shift+Control
    00812             {KBDNLS_NULL,0},  // Alt
    00813             {KBDNLS_NULL,0},  // Shift+Alt
    00814             {KBDNLS_NULL,0},  // Control+Alt
    00815             {KBDNLS_NULL,0}   // Shift+Control+Alt
    00816         }
    00817     },
    00818     {
    00819         VK_HOME,             // Base Vk  PC98_HOME  key
    00820         KBDNLS_TYPE_NORMAL,  // NLSFEProcType
    00821         KBDNLS_INDEX_NORMAL, // NLSFEProcCurrent
    00822         0x0,                 // NLSFEProcSwitch
    00823         {                    // NLSFEProc
    00824             {KBDNLS_HOME_OR_CLEAR,0},         // Base
    00825             {KBDNLS_SEND_BASE_VK,0},          // Shift
    00826             {KBDNLS_HOME_OR_CLEAR,0},         // Control
    00827             {KBDNLS_HOME_OR_CLEAR,0},         // Shift+Control
    00828             {KBDNLS_HOME_OR_CLEAR,0},         // Alt
    00829             {KBDNLS_HOME_OR_CLEAR,0},         // Shift+Alt
    00830             {KBDNLS_HOME_OR_CLEAR,0},         // Control+Alt
    00831             {KBDNLS_HOME_OR_CLEAR,0}          // Shift+Control+Alt
    00832         },
    00833         {                     // NLSFEProcIndexAlt
    00834             {KBDNLS_NULL,0},  // Base
    00835             {KBDNLS_NULL,0},  // Shift
    00836             {KBDNLS_NULL,0},  // Control
    00837             {KBDNLS_NULL,0},  // Shift+Control
    00838             {KBDNLS_NULL,0},  // Alt
    00839             {KBDNLS_NULL,0},  // Shift+Alt
    00840             {KBDNLS_NULL,0},  // Control+Alt
    00841             {KBDNLS_NULL,0}   // Shift+Control+Alt
    00842         }
    00843     },
    00844     {
    00845         VK_END,              // Base Vk  PC98_HELP  key
    00846         KBDNLS_TYPE_NORMAL,  // NLSFEProcType
    00847         KBDNLS_INDEX_NORMAL, // NLSFEProcCurrent
    00848         0x0,                 // NLSFEProcSwitch
    00849         {                    // NLSFEProc
    00850             {KBDNLS_HELP_OR_END,0},         // Base
    00851             {KBDNLS_HELP_OR_END,0},         // Shift
    00852             {KBDNLS_HELP_OR_END,0},         // Control
    00853             {KBDNLS_HELP_OR_END,0},         // Shift+Control
    00854             {KBDNLS_HELP_OR_END,0},         // Alt
    00855             {KBDNLS_HELP_OR_END,0},         // Shift+Alt
    00856             {KBDNLS_HELP_OR_END,0},         // Control+Alt
    00857             {KBDNLS_HELP_OR_END,0}          // Shift+Control+Alt
    00858         },
    00859         {                     // NLSFEProcIndexAlt
    00860             {KBDNLS_NULL,0},  // Base
    00861             {KBDNLS_NULL,0},  // Shift
    00862             {KBDNLS_NULL,0},  // Control
    00863             {KBDNLS_NULL,0},  // Shift+Control
    00864             {KBDNLS_NULL,0},  // Alt
    00865             {KBDNLS_NULL,0},  // Shift+Alt
    00866             {KBDNLS_NULL,0},  // Control+Alt
    00867             {KBDNLS_NULL,0}   // Shift+Control+Alt
    00868         }
    00869     },
    00870     {
    00871         VK_NUMPAD0,          // Base Vk
    00872         KBDNLS_TYPE_NORMAL,  // NLSFEProcType
    00873         KBDNLS_INDEX_NORMAL, // NLSFEProcCurrent
    00874         0x0,                 // NLSFEProcSwitch
    00875         {                    // NLSFEProc
    00876             {KBDNLS_NUMPAD,0},         // Base
    00877             {KBDNLS_NUMPAD,0},         // Shift
    00878             {KBDNLS_NUMPAD,0},         // Control
    00879             {KBDNLS_NUMPAD,0},         // Shift+Control
    00880             {KBDNLS_NUMPAD,0},         // Alt
    00881             {KBDNLS_NUMPAD,0},         // Shift+Alt
    00882             {KBDNLS_NUMPAD,0},         // Control+Alt
    00883             {KBDNLS_NUMPAD,0}          // Shift+Control+Alt
    00884         },
    00885         {                     // NLSFEProcIndexAlt
    00886             {KBDNLS_NULL,0},  // Base
    00887             {KBDNLS_NULL,0},  // Shift
    00888             {KBDNLS_NULL,0},  // Control
    00889             {KBDNLS_NULL,0},  // Shift+Control
    00890             {KBDNLS_NULL,0},  // Alt
    00891             {KBDNLS_NULL,0},  // Shift+Alt
    00892             {KBDNLS_NULL,0},  // Control+Alt
    00893             {KBDNLS_NULL,0}   // Shift+Control+Alt
    00894         }
    00895     },
    00896     {
    00897         VK_NUMPAD1,          // Base Vk
    00898         KBDNLS_TYPE_NORMAL,  // NLSFEProcType
    00899         KBDNLS_INDEX_NORMAL, // NLSFEProcCurrent
    00900         0x0,                 // NLSFEProcSwitch
    00901         {                    // NLSFEProc
    00902             {KBDNLS_NUMPAD,0},         // Base
    00903             {KBDNLS_NUMPAD,0},         // Shift
    00904             {KBDNLS_NUMPAD,0},         // Control
    00905             {KBDNLS_NUMPAD,0},         // Shift+Control
    00906             {KBDNLS_NUMPAD,0},         // Alt
    00907             {KBDNLS_NUMPAD,0},         // Shift+Alt
    00908             {KBDNLS_NUMPAD,0},         // Control+Alt
    00909             {KBDNLS_NUMPAD,0}          // Shift+Control+Alt
    00910         },
    00911         {                     // NLSFEProcIndexAlt
    00912             {KBDNLS_NULL,0},  // Base
    00913             {KBDNLS_NULL,0},  // Shift
    00914             {KBDNLS_NULL,0},  // Control
    00915             {KBDNLS_NULL,0},  // Shift+Control
    00916             {KBDNLS_NULL,0},  // Alt
    00917             {KBDNLS_NULL,0},  // Shift+Alt
    00918             {KBDNLS_NULL,0},  // Control+Alt
    00919             {KBDNLS_NULL,0}   // Shift+Control+Alt
    00920         }
    00921     },
    00922     {
    00923         VK_NUMPAD2,          // Base Vk
    00924         KBDNLS_TYPE_NORMAL,  // NLSFEProcType
    00925         KBDNLS_INDEX_NORMAL, // NLSFEProcCurrent
    00926         0x0,                 // NLSFEProcSwitch
    00927         {                    // NLSFEProc
    00928             {KBDNLS_NUMPAD,0},         // Base
    00929             {KBDNLS_NUMPAD,0},         // Shift
    00930             {KBDNLS_NUMPAD,0},         // Control
    00931             {KBDNLS_NUMPAD,0},         // Shift+Control
    00932             {KBDNLS_NUMPAD,0},         // Alt
    00933             {KBDNLS_NUMPAD,0},         // Shift+Alt
    00934             {KBDNLS_NUMPAD,0},         // Control+Alt
    00935             {KBDNLS_NUMPAD,0}          // Shift+Control+Alt
    00936         },
    00937         {                     // NLSFEProcIndexAlt
    00938             {KBDNLS_NULL,0},  // Base
    00939             {KBDNLS_NULL,0},  // Shift
    00940             {KBDNLS_NULL,0},  // Control
    00941             {KBDNLS_NULL,0},  // Shift+Control
    00942             {KBDNLS_NULL,0},  // Alt
    00943             {KBDNLS_NULL,0},  // Shift+Alt
    00944             {KBDNLS_NULL,0},  // Control+Alt
    00945             {KBDNLS_NULL,0}   // Shift+Control+Alt
    00946         }
    00947     },
    00948     {
    00949         VK_NUMPAD3,          // Base Vk
    00950         KBDNLS_TYPE_NORMAL,  // NLSFEProcType
    00951         KBDNLS_INDEX_NORMAL, // NLSFEProcCurrent
    00952         0x0,                 // NLSFEProcSwitch
    00953         {                    // NLSFEProc
    00954             {KBDNLS_NUMPAD,0},         // Base
    00955             {KBDNLS_NUMPAD,0},         // Shift
    00956             {KBDNLS_NUMPAD,0},         // Control
    00957             {KBDNLS_NUMPAD,0},         // Shift+Control
    00958             {KBDNLS_NUMPAD,0},         // Alt
    00959             {KBDNLS_NUMPAD,0},         // Shift+Alt
    00960             {KBDNLS_NUMPAD,0},         // Control+Alt
    00961             {KBDNLS_NUMPAD,0}          // Shift+Control+Alt
    00962         },
    00963         {                     // NLSFEProcIndexAlt
    00964             {KBDNLS_NULL,0},  // Base
    00965             {KBDNLS_NULL,0},  // Shift
    00966             {KBDNLS_NULL,0},  // Control
    00967             {KBDNLS_NULL,0},  // Shift+Control
    00968             {KBDNLS_NULL,0},  // Alt
    00969             {KBDNLS_NULL,0},  // Shift+Alt
    00970             {KBDNLS_NULL,0},  // Control+Alt
    00971             {KBDNLS_NULL,0}   // Shift+Control+Alt
    00972         }
    00973     },
    00974     {
    00975         VK_NUMPAD4,          // Base Vk
    00976         KBDNLS_TYPE_NORMAL,  // NLSFEProcType
    00977         KBDNLS_INDEX_NORMAL, // NLSFEProcCurrent
    00978         0x0,                 // NLSFEProcSwitch
    00979         {                    // NLSFEProc
    00980             {KBDNLS_NUMPAD,0},         // Base
    00981             {KBDNLS_NUMPAD,0},         // Shift
    00982             {KBDNLS_NUMPAD,0},         // Control
    00983             {KBDNLS_NUMPAD,0},         // Shift+Control
    00984             {KBDNLS_NUMPAD,0},         // Alt
    00985             {KBDNLS_NUMPAD,0},         // Shift+Alt
    00986             {KBDNLS_NUMPAD,0},         // Control+Alt
    00987             {KBDNLS_NUMPAD,0}          // Shift+Control+Alt
    00988         },
    00989         {                     // NLSFEProcIndexAlt
    00990             {KBDNLS_NULL,0},  // Base
    00991             {KBDNLS_NULL,0},  // Shift
    00992             {KBDNLS_NULL,0},  // Control
    00993             {KBDNLS_NULL,0},  // Shift+Control
    00994             {KBDNLS_NULL,0},  // Alt
    00995             {KBDNLS_NULL,0},  // Shift+Alt
    00996             {KBDNLS_NULL,0},  // Control+Alt
    00997             {KBDNLS_NULL,0}   // Shift+Control+Alt
    00998         }
    00999     },
    01000     {
    01001         VK_NUMPAD5,          // Base Vk
    01002         KBDNLS_TYPE_NORMAL,  // NLSFEProcType
    01003         KBDNLS_INDEX_NORMAL, // NLSFEProcCurrent
    01004         0x0,                 // NLSFEProcSwitch
    01005         {                    // NLSFEProc
    01006             {KBDNLS_NUMPAD,0},         // Base
    01007             {KBDNLS_NUMPAD,0},         // Shift
    01008             {KBDNLS_NUMPAD,0},         // Control
    01009             {KBDNLS_NUMPAD,0},         // Shift+Control
    01010             {KBDNLS_NUMPAD,0},         // Alt
    01011             {KBDNLS_NUMPAD,0},         // Shift+Alt
    01012             {KBDNLS_NUMPAD,0},         // Control+Alt
    01013             {KBDNLS_NUMPAD,0}          // Shift+Control+Alt
    01014         },
    01015         {                     // NLSFEProcIndexAlt
    01016             {KBDNLS_NULL,0},  // Base
    01017             {KBDNLS_NULL,0},  // Shift
    01018             {KBDNLS_NULL,0},  // Control
    01019             {KBDNLS_NULL,0},  // Shift+Control
    01020             {KBDNLS_NULL,0},  // Alt
    01021             {KBDNLS_NULL,0},  // Shift+Alt
    01022             {KBDNLS_NULL,0},  // Control+Alt
    01023             {KBDNLS_NULL,0}   // Shift+Control+Alt
    01024         }
    01025     },
    01026     {
    01027         VK_NUMPAD6,          // Base Vk
    01028         KBDNLS_TYPE_NORMAL,  // NLSFEProcType
    01029         KBDNLS_INDEX_NORMAL, // NLSFEProcCurrent
    01030         0x0,                 // NLSFEProcSwitch
    01031         {                    // NLSFEProc
    01032             {KBDNLS_NUMPAD,0},         // Base
    01033             {KBDNLS_NUMPAD,0},         // Shift
    01034             {KBDNLS_NUMPAD,0},         // Control
    01035             {KBDNLS_NUMPAD,0},         // Shift+Control
    01036             {KBDNLS_NUMPAD,0},         // Alt
    01037             {KBDNLS_NUMPAD,0},         // Shift+Alt
    01038             {KBDNLS_NUMPAD,0},         // Control+Alt
    01039             {KBDNLS_NUMPAD,0}          // Shift+Control+Alt
    01040         },
    01041         {                     // NLSFEProcIndexAlt
    01042             {KBDNLS_NULL,0},  // Base
    01043             {KBDNLS_NULL,0},  // Shift
    01044             {KBDNLS_NULL,0},  // Control
    01045             {KBDNLS_NULL,0},  // Shift+Control
    01046             {KBDNLS_NULL,0},  // Alt
    01047             {KBDNLS_NULL,0},  // Shift+Alt
    01048             {KBDNLS_NULL,0},  // Control+Alt
    01049             {KBDNLS_NULL,0}   // Shift+Control+Alt
    01050         }
    01051     },
    01052     {
    01053         VK_NUMPAD7,          // Base Vk
    01054         KBDNLS_TYPE_NORMAL,  // NLSFEProcType
    01055         KBDNLS_INDEX_NORMAL, // NLSFEProcCurrent
    01056         0x0,                 // NLSFEProcSwitch
    01057         {                    // NLSFEProc
    01058             {KBDNLS_NUMPAD,0},         // Base
    01059             {KBDNLS_NUMPAD,0},         // Shift
    01060             {KBDNLS_NUMPAD,0},         // Control
    01061             {KBDNLS_NUMPAD,0},         // Shift+Control
    01062             {KBDNLS_NUMPAD,0},         // Alt
    01063             {KBDNLS_NUMPAD,0},         // Shift+Alt
    01064             {KBDNLS_NUMPAD,0},         // Control+Alt
    01065             {KBDNLS_NUMPAD,0}          // Shift+Control+Alt
    01066         },
    01067         {                     // NLSFEProcIndexAlt
    01068             {KBDNLS_NULL,0},  // Base
    01069             {KBDNLS_NULL,0},  // Shift
    01070             {KBDNLS_NULL,0},  // Control
    01071             {KBDNLS_NULL,0},  // Shift+Control
    01072             {KBDNLS_NULL,0},  // Alt
    01073             {KBDNLS_NULL,0},  // Shift+Alt
    01074             {KBDNLS_NULL,0},  // Control+Alt
    01075             {KBDNLS_NULL,0}   // Shift+Control+Alt
    01076         }
    01077     },
    01078     {
    01079         VK_NUMPAD8,          // Base Vk
    01080         KBDNLS_TYPE_NORMAL,  // NLSFEProcType
    01081         KBDNLS_INDEX_NORMAL, // NLSFEProcCurrent
    01082         0x0,                 // NLSFEProcSwitch
    01083         {                    // NLSFEProc
    01084             {KBDNLS_NUMPAD,0},         // Base
    01085             {KBDNLS_NUMPAD,0},         // Shift
    01086             {KBDNLS_NUMPAD,0},         // Control
    01087             {KBDNLS_NUMPAD,0},         // Shift+Control
    01088             {KBDNLS_NUMPAD,0},         // Alt
    01089             {KBDNLS_NUMPAD,0},         // Shift+Alt
    01090             {KBDNLS_NUMPAD,0},         // Control+Alt
    01091             {KBDNLS_NUMPAD,0}          // Shift+Control+Alt
    01092         },
    01093         {                     // NLSFEProcIndexAlt
    01094             {KBDNLS_NULL,0},  // Base
    01095             {KBDNLS_NULL,0},  // Shift
    01096             {KBDNLS_NULL,0},  // Control
    01097             {KBDNLS_NULL,0},  // Shift+Control
    01098             {KBDNLS_NULL,0},  // Alt
    01099             {KBDNLS_NULL,0},  // Shift+Alt
    01100             {KBDNLS_NULL,0},  // Control+Alt
    01101             {KBDNLS_NULL,0}   // Shift+Control+Alt
    01102         }
    01103     },
    01104     {
    01105         VK_NUMPAD9,          // Base Vk
    01106         KBDNLS_TYPE_NORMAL,  // NLSFEProcType
    01107         KBDNLS_INDEX_NORMAL, // NLSFEProcCurrent
    01108         0x0,                 // NLSFEProcSwitch
    01109         {                    // NLSFEProc
    01110             {KBDNLS_NUMPAD,0},         // Base
    01111             {KBDNLS_NUMPAD,0},         // Shift
    01112             {KBDNLS_NUMPAD,0},         // Control
    01113             {KBDNLS_NUMPAD,0},         // Shift+Control
    01114             {KBDNLS_NUMPAD,0},         // Alt
    01115             {KBDNLS_NUMPAD,0},         // Shift+Alt
    01116             {KBDNLS_NUMPAD,0},         // Control+Alt
    01117             {KBDNLS_NUMPAD,0}          // Shift+Control+Alt
    01118         },
    01119         {                     // NLSFEProcIndexAlt
    01120             {KBDNLS_NULL,0},  // Base
    01121             {KBDNLS_NULL,0},  // Shift
    01122             {KBDNLS_NULL,0},  // Control
    01123             {KBDNLS_NULL,0},  // Shift+Control
    01124             {KBDNLS_NULL,0},  // Alt
    01125             {KBDNLS_NULL,0},  // Shift+Alt
    01126             {KBDNLS_NULL,0},  // Control+Alt
    01127             {KBDNLS_NULL,0}   // Shift+Control+Alt
    01128         }
    01129     },
    01130     {
    01131         VK_DECIMAL,          // Base Vk  PC98_"."  key
    01132         KBDNLS_TYPE_NORMAL,  // NLSFEProcType
    01133         KBDNLS_INDEX_NORMAL, // NLSFEProcCurrent
    01134         0x0,                 // NLSFEProcSwitch
    01135         {                    // NLSFEProc
    01136             {KBDNLS_NUMPAD,0},         // Base
    01137             {KBDNLS_NUMPAD,0},         // Shift
    01138             {KBDNLS_NUMPAD,0},         // Control
    01139             {KBDNLS_NUMPAD,0},         // Shift+Control
    01140             {KBDNLS_NUMPAD,0},         // Alt
    01141             {KBDNLS_NUMPAD,0},         // Shift+Alt
    01142             {KBDNLS_NUMPAD,0},         // Control+Alt
    01143             {KBDNLS_NUMPAD,0}          // Shift+Control+Alt
    01144         },
    01145         {                     // NLSFEProcIndexAlt
    01146             {KBDNLS_NULL,0},  // Base
    01147             {KBDNLS_NULL,0},  // Shift
    01148             {KBDNLS_NULL,0},  // Control
    01149             {KBDNLS_NULL,0},  // Shift+Control
    01150             {KBDNLS_NULL,0},  // Alt
    01151             {KBDNLS_NULL,0},  // Shift+Alt
    01152             {KBDNLS_NULL,0},  // Control+Alt
    01153             {KBDNLS_NULL,0}   // Shift+Control+Alt
    01154         }
    01155     }
    01156 };
    01157
    01158 USHORT ausMouseVKey98[] = {
    01159                        VK_NUMPAD5,
    01160                        VK_NUMPAD9,
    01161                        VK_NUMPAD3,
    01162                        VK_NUMPAD1,
    01163                        VK_NUMPAD7,
    01164                        VK_NUMPAD4,
    01165                        VK_NUMPAD8,
    01166                        VK_NUMPAD6,
    01167                        VK_NUMPAD2,
    01168                        VK_NUMPAD0,
    01169                        VK_DECIMAL,
    01170                        VK_MULTIPLY,
    01171                        VK_ADD,
    01172                        VK_SUBTRACT,
    01173                        VK_DIVIDE | KBDEXT,
    01174                        VK_HOME | KBDEXT
    01175                       };
    01176 #endif // defined(_PC98_)
    01177 /***********************************************************************\
    01178 * KbdNlsTables
    01179 *
    01180 \***********************************************************************/
    01181
    01182 static ALLOC_SECTION_LDATA KBDNLSTABLES KbdNlsTables = {
    01183 #if defined(_PC98_)
    01184 #if 1
    01185     0,
    01186 #else
    01187     0x0d,                            // OEM ID (0x0d = NEC)
    01188 #endif
    01189     NLSKBD_INFO_ACCESSIBILITY_KEYMAP,// Information
    01190     16,                              // Number of VK_F entry
    01191     VkToFuncTable_NEC,               // Pointer to VK_F array
    01192     16,                              // Number of MouseVk entry
    01193     ausMouseVKey98                   // Pointer to MouseVk array
    01194 #else // defined(_PC98_)
    01195     0,                      // OEM ID (0 = Microsoft)
    01196     0,                      // Information
    01197     4,                      // Number of VK_F entry
    01198     VkToFuncTable_106,      // Pointer to VK_F array
    01199     0,                      // Number of MouseVk entry
    01200     NULL                    // Pointer to MouseVk array
    01201 #endif // defined(_PC98_)
    01202 };
    01203
    01204 PKBDNLSTABLES KbdNlsLayerDescriptor(VOID)
    01205 {
    01206     return &KbdNlsTables;
    01207 }