test: kbdlk41j.c Source File

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

# kbdlk41j.c

Go to the documentation of this file.

    00001 /***************************************************************************\
    00002 * Module Name: kbdlk41j.c
    00003 *
    00004 * DEC LK411-JJ keyboard layout driver
    00005 *
    00006 * History:
    00007 * 20-SEP-1996: Nakazato(v-mnakaz, DEC-J) created
    00008 \***************************************************************************/
    00009
    00010 #include <windows.h>
    00011 #include <ime.h>
    00012 #include "vkoem.h"
    00013 #include "kbdjpn.h"
    00014 #include "kbdlk41j.h"
    00015
    00016 #if defined(_M_IA64)
    00017 #pragma section(".data")
    00018 #define ALLOC_SECTION_LDATA __declspec(allocate(".data"))
    00019 #else
    00020 #pragma data_seg(".data")
    00021 #define ALLOC_SECTION_LDATA
    00022 #endif
    00023
    00024 /***************************************************************************\
    00025 * ausVK[] - Virtual Scan Code to Virtual Key conversion table for LK411-J
    00026 \***************************************************************************/
    00027
    00028 static ALLOC_SECTION_LDATA USHORT ausVK[] = {
    00029     T00, T01, T02, T03, T04, T05, T06, T07,
    00030     T08, T09, T0A, T0B, T0C, T0D, T0E, T0F,
    00031     T10, T11, T12, T13, T14, T15, T16, T17,
    00032     T18, T19, T1A, T1B, T1C, T1D, T1E, T1F,
    00033     T20, T21, T22, T23, T24, T25, T26, T27,
    00034     T28,
    00035
    00036     // LK411-JJ doesn't use this key(Use Alt+Conversion key to use IME)
    00037     T29,
    00038
    00039     T2A, T2B, T2C, T2D, T2E, T2F,
    00040     T30, T31, T32, T33, T34, T35,
    00041
    00042      // Right-hand Shift key must have KBDEXT bit set.
    00043     T36 | KBDEXT,
    00044
    00045      // numpad_* + Shift/Alt -> SnapShot
    00046     T37 | KBDMULTIVK,
    00047
    00048     T38, T39,
    00049
    00050      // Alphanumeric/CapsLock key must have KBDSPECIAL bit set (NLS key)
    00051     T3A | KBDSPECIAL,
    00052
    00053     T3B, T3C, T3D, T3E, T3F,
    00054     T40, T41, T42, T43, T44,
    00055
    00056      // NumLock Key:
    00057      //     KBDEXT     - VK_NUMLOCK is an Extended key
    00058      //     KBDMULTIVK - VK_NUMLOCK or VK_PAUSE (without or with CTRL)
    00059     T45 | KBDEXT | KBDMULTIVK,
    00060
    00061     T46 | KBDMULTIVK,
    00062
    00063      // Number Pad keys:
    00064      //    KBDNUMPAD  - digits 0-9 and decimal point.
    00065      //    KBDSPECIAL - require special processing by Windows
    00066     T47 | KBDNUMPAD | KBDSPECIAL,   // Numpad 7 (Home)
    00067     T48 | KBDNUMPAD | KBDSPECIAL,   // Numpad 8 (Up),
    00068     T49 | KBDNUMPAD | KBDSPECIAL,   // Numpad 9 (PgUp),
    00069     T4A,
    00070     T4B | KBDNUMPAD | KBDSPECIAL,   // Numpad 4 (Left),
    00071     T4C | KBDNUMPAD | KBDSPECIAL,   // Numpad 5 (Clear),
    00072     T4D | KBDNUMPAD | KBDSPECIAL,   // Numpad 6 (Right),
    00073     T4E,
    00074     T4F | KBDNUMPAD | KBDSPECIAL,   // Numpad 1 (End),
    00075     T50 | KBDNUMPAD | KBDSPECIAL,   // Numpad 2 (Down),
    00076     T51 | KBDNUMPAD | KBDSPECIAL,   // Numpad 3 (PgDn),
    00077     T52 | KBDNUMPAD | KBDSPECIAL,   // Numpad 0 (Ins),
    00078     T53 | KBDNUMPAD | KBDSPECIAL,   // Numpad . (Del),
    00079
    00080     T54, T55, T56, T57, T58, T59, T5A, T5B,
    00081     T5C, T5D, T5E, T5F, T60, T61, T62, T63,
    00082     T64, T65, T66, T67, T68, T69, T6A, T6B,
    00083     T6C, T6D, T6E, T6F,
    00084
    00085      // Hiragana/Katakana/Roman key must have KBDSPECIAL bit set (NLS key)
    00086     T70 | KBDSPECIAL,
    00087
    00088     T71, T72, T73,
    00089     T74, T75, T76, T77, T78,
    00090
    00091      // Conversion key must have KBDSPECIAL bit set (NLS key)
    00092     T79 | KBDSPECIAL,
    00093
    00094     T7A,
    00095
    00096      // Non-Conversion key must have KBDSPECIAL bit set (NLS key)
    00097     T7B | KBDSPECIAL,
    00098
    00099     T7C, T7D, T7E, T7F
    00100 };
    00101
    00102
    00103 static ALLOC_SECTION_LDATA VSC_VK aE0VscToVk[] = {
    00104         { 0x0F, X0F | KBDEXT | KBDSPECIAL | KBDMULTIVK },       // LK411 added (kana key)
    00105         { 0x1C, X1C | KBDEXT              },  // Numpad Enter
    00106         { 0x1D, X1D | KBDEXT              },  // RControl
    00107         { 0x35, X35 | KBDEXT              },  // Numpad Divide
    00108         { 0x37, X37 | KBDEXT              },  // Snapshot
    00109         { 0x38, X38 | KBDEXT              },  // RMenu
    00110         { 0x3D, X3D | KBDEXT              },  // F13            // LK411 added
    00111         { 0x3E, X3E | KBDEXT              },  // F14            // LK411 added
    00112         { 0x3F, X3F | KBDEXT              },  // F15 (Help)     // LK411 added
    00113         { 0x40, X40 | KBDEXT              },  // F16 (Do)       // LK411 added
    00114         { 0x41, X41 | KBDEXT              },  // F17            // LK411 added
    00115         { 0x46, X46 | KBDEXT              },  // Break (Ctrl + Pause)   // LK411 removed (@@ check)
    00116         { 0x47, X47 | KBDEXT              },  // Home
    00117         { 0x48, X48 | KBDEXT              },  // Up
    00118         { 0x49, X49 | KBDEXT              },  // Prior
    00119         { 0x4B, X4B | KBDEXT              },  // Left
    00120         { 0x4D, X4D | KBDEXT              },  // Right
    00121         { 0x4E, X4E | KBDEXT              },  // Keypad Minus       // LK411
    00122         { 0x4F, X4F | KBDEXT              },  // End
    00123         { 0x50, X50 | KBDEXT              },  // Down
    00124         { 0x51, X51 | KBDEXT              },  // Next
    00125         { 0x52, X52 | KBDEXT              },  // Insert
    00126         { 0x53, X53 | KBDEXT              },  // Delete
    00127 //      { 0x5B, X5B | KBDEXT              },  // Left Win       // LK411 remove
    00128 //      { 0x5C, X5C | KBDEXT              },  // Right Win      // LK411 remove
    00129 //      { 0x5D, X5D | KBDEXT              },  // Application        // LK411 remove
    00130         { 0,      0                       }
    00131 };
    00132
    00133
    00134 static ALLOC_SECTION_LDATA VSC_VK aE1VscToVk[] = {
    00135         { 0x1D, Y1D                       },  // Pause
    00136         { 0   ,   0                       }
    00137 };
    00138
    00139
    00140
    00141 /***************************************************************************\
    00142 * aVkToBits[]  - map Virtual Keys to Modifier Bits
    00143 *
    00144 * See kbd.h for a full description.
    00145 *
    00146 * US Keyboard has only three shifter keys:
    00147 *     SHIFT (L & R) affects alphabnumeric keys,
    00148 *     CTRL  (L & R) is used to generate control characters
    00149 *     ALT   (L & R) used for generating characters by number with numpad
    00150 \***************************************************************************/
    00151
    00152 static ALLOC_SECTION_LDATA VK_TO_BIT aVkToBits[] = {
    00153     { VK_SHIFT,   KBDSHIFT },   // 1st bit (0001)
    00154     { VK_CONTROL, KBDCTRL  },   // 2nd bit (0010)
    00155     { VK_MENU,    KBDALT   },   // 4th bit (0100)
    00156     { VK_KANA,    KBDKANA  },   // 8th bit (1000)
    00157     { 0,          0        }
    00158 };
    00159
    00160
    00161
    00162 /***************************************************************************\
    00163 * aModification[]  - map character modifier bits to modification number
    00164 *
    00165 * See kbd.h for a full description.
    00166 *
    00167 \***************************************************************************/
    00168
    00169 static ALLOC_SECTION_LDATA MODIFIERS CharModifiers = {
    00170     &aVkToBits[0],
    00171     11,
    00172     {
    00173     //  Modification# // bit    Keys Pressed  : Explanation
    00174     //  ============= // ====  ============== : =============================
    00175         0,            // 0000                 : unshifted characters
    00176         1,            // 0001           SHIFT : capitals, ~!@#$%^&*()_+{}:"<>? etc.
    00177         4,            // 0010      CTRL       : control characters
    00178         6,            // 0011      CTRL SHIFT :
    00179         SHFT_INVALID, // 0100  ALT            : invalid
    00180         SHFT_INVALID, // 0101  ALT      SHIFT : invalid
    00181         SHFT_INVALID, // 0110  ALT CTRL       : invalid
    00182         SHFT_INVALID, // 0111  ALT CTRL SHIFT : invalid
    00183         2,            // 1000  KANA
    00184         3,            // 1001  KANA      SHIFT
    00185         5,            // 1010  KANA CTRL
    00186         7             // 1011  KANA CTRL SHIFT
    00187     }
    00188 };
    00189
    00190
    00191
    00192 /***************************************************************************\
    00193 *
    00194 * aVkToWch4[]  - Virtual Key to WCHAR translation for 4 shift states
    00195 * aVkToWch6[]  - Virtual Key to WCHAR translation for 6 shift states
    00196 * aVkToWch8[]  - Virtual Key to WCHAR translation for 8 shift states
    00197 * aVkToWch1[]  - Virtual Key to WCHAR translation for NUMPAD
    00198 *
    00199 * Table attributes: Unordered Scan, null-terminated
    00200 *
    00201 * Search this table for an entry with a matching Virtual Key to find the
    00202 * corresponding unshifted and shifted WCHAR characters.
    00203 *
    00204 * Reserved VirtualKey values (first column)
    00205 *     -1            - this line contains dead characters (diacritic)
    00206 *     0             - terminator
    00207 *
    00208 * Reserved Attribute values (second column)
    00209 *     CAPLOK        - CapsLock affects this key like Shift
    00210 *     KANALOK       - The KANA-LOCK key affects this key like KANA
    00211 *
    00212 * Reserved character values (third through last column)
    00213 *     WCH_NONE      - No character
    00214 *     WCH_DEAD      - Dead character (diacritic) value is in next line
    00215 *
    00216 \***************************************************************************/
    00217
    00218 static ALLOC_SECTION_LDATA VK_TO_WCHARS4 aVkToWch4[] = {
    00219     //                               |          |   SHIFT  |  KANA  | K+SHFT |
    00220     //                               |          |==========|========|========|
    00221     {'0'          ,          KANALOK ,'0'       ,WCH_NONE  ,WCH_WA  ,WCH_WO  },
    00222     {'1'          ,          KANALOK ,'1'       ,'!'       ,WCH_NU  ,WCH_NU  },
    00223     {'3'          ,          KANALOK ,'3'       ,'#'       ,WCH_A   ,WCH_AA  },
    00224     {'4'          ,          KANALOK ,'4'       ,'$'       ,WCH_U   ,WCH_UU  },
    00225     {'5'          ,          KANALOK ,'5'       ,'%'       ,WCH_E   ,WCH_EE  },
    00226     {'7'          ,          KANALOK ,'7'       ,0x27      ,WCH_YA  ,WCH_YAA },
    00227     {'8'          ,          KANALOK ,'8'       ,'('       ,WCH_YU  ,WCH_YUU },
    00228     {'9'          ,          KANALOK ,'9'       ,')'       ,WCH_YO  ,WCH_YOO },
    00229     {'A'          , CAPLOK | KANALOK ,'a'       ,'A'       ,WCH_TI  ,WCH_TI  },
    00230     {'B'          , CAPLOK | KANALOK ,'b'       ,'B'       ,WCH_KO  ,WCH_KO  },
    00231     {'C'          , CAPLOK | KANALOK ,'c'       ,'C'       ,WCH_SO  ,WCH_SO  },
    00232     {'D'          , CAPLOK | KANALOK ,'d'       ,'D'       ,WCH_SI  ,WCH_SI  },
    00233     {'E'          , CAPLOK | KANALOK ,'e'       ,'E'       ,WCH_I   ,WCH_II  },
    00234     {'F'          , CAPLOK | KANALOK ,'f'       ,'F'       ,WCH_HA  ,WCH_HA  },
    00235     {'G'          , CAPLOK | KANALOK ,'g'       ,'G'       ,WCH_KI  ,WCH_KI  },
    00236     {'H'          , CAPLOK | KANALOK ,'h'       ,'H'       ,WCH_KU  ,WCH_KU  },
    00237     {'I'          , CAPLOK | KANALOK ,'i'       ,'I'       ,WCH_NI  ,WCH_NI  },
    00238     {'J'          , CAPLOK | KANALOK ,'j'       ,'J'       ,WCH_MA  ,WCH_MA  },
    00239     {'K'          , CAPLOK | KANALOK ,'k'       ,'K'       ,WCH_NO  ,WCH_NO  },
    00240     {'L'          , CAPLOK | KANALOK ,'l'       ,'L'       ,WCH_RI  ,WCH_RI  },
    00241     {'M'          , CAPLOK | KANALOK ,'m'       ,'M'       ,WCH_MO  ,WCH_MO  },
    00242     {'N'          , CAPLOK | KANALOK ,'n'       ,'N'       ,WCH_MI  ,WCH_MI  },
    00243     {'O'          , CAPLOK | KANALOK ,'o'       ,'O'       ,WCH_RA  ,WCH_RA  },
    00244     {'P'          , CAPLOK | KANALOK ,'p'       ,'P'       ,WCH_SE  ,WCH_SE  },
    00245     {'Q'          , CAPLOK | KANALOK ,'q'       ,'Q'       ,WCH_TA  ,WCH_TA  },
    00246     {'R'          , CAPLOK | KANALOK ,'r'       ,'R'       ,WCH_SU  ,WCH_SU  },
    00247     {'S'          , CAPLOK | KANALOK ,'s'       ,'S'       ,WCH_TO  ,WCH_TO  },
    00248     {'T'          , CAPLOK | KANALOK ,'t'       ,'T'       ,WCH_KA  ,WCH_KA  },
    00249     {'U'          , CAPLOK | KANALOK ,'u'       ,'U'       ,WCH_NA  ,WCH_NA  },
    00250     {'V'          , CAPLOK | KANALOK ,'v'       ,'V'       ,WCH_HI  ,WCH_HI  },
    00251     {'W'          , CAPLOK | KANALOK ,'w'       ,'W'       ,WCH_TE  ,WCH_TE  },
    00252     {'X'          , CAPLOK | KANALOK ,'x'       ,'X'       ,WCH_SA  ,WCH_SA  },
    00253     {'Y'          , CAPLOK | KANALOK ,'y'       ,'Y'       ,WCH_NN  ,WCH_NN  },
    00254     {'Z'          , CAPLOK | KANALOK ,'z'       ,'Z'       ,WCH_TU  ,WCH_TUU },
    00255     {VK_OEM_1     ,          KANALOK ,':'       ,'*'       ,WCH_KE  ,WCH_KE  },
    00256     {VK_OEM_2     ,          KANALOK ,'/'       ,'?'       ,WCH_ME  ,WCH_MD  },
    00257     {VK_OEM_3     ,          KANALOK ,'@'       ,'`'       ,WCH_VS  ,WCH_VS  },
    00258     {VK_OEM_7     ,          KANALOK ,'^'       ,'~'       ,WCH_HE  ,WCH_HE  },
    00259 //  {VK_OEM_8     , 0                ,','       ,','       ,','     ,','     },     //LK411 removed
    00260     {VK_OEM_COMMA ,          KANALOK ,','       ,'<'       ,WCH_NE  ,WCH_IC  },
    00261     {VK_OEM_PERIOD,          KANALOK ,'.'       ,'>'       ,WCH_RU  ,WCH_IP  },
    00262     {VK_OEM_PLUS  ,          KANALOK ,';'       ,'+'       ,WCH_RE  ,WCH_RE  },
    00263     {VK_TAB       , 0                ,'\t'      ,'\t'      ,'\t'    ,'\t'    },
    00264     {VK_ADD       , 0                ,'+'       ,'+'       ,'+'     ,'+'     },
    00265     {VK_DECIMAL   , 0                ,'.'       ,'.'       ,'.'     ,'.'     },
    00266     {VK_DIVIDE    , 0                ,'/'       ,'/'       ,'/'     ,'/'     },
    00267     {VK_MULTIPLY  , 0                ,'*'       ,'*'       ,'*'     ,'*'     },
    00268     {VK_SUBTRACT  , 0                ,'-'       ,'-'       ,'-'     ,'-'     },
    00269     {0            , 0                ,0         ,0         ,0       ,0       }
    00270 };
    00271
    00272
    00273 static ALLOC_SECTION_LDATA VK_TO_WCHARS6 aVkToWch6[] = {
    00274     //                      |          |   SHIFT  |  KANA  | K+SHFT |  CONTROL  |  K+CTRL   |
    00275     //                      |          |==========|========|========|===========|===========|
    00276     {VK_BACK      , 0       ,'\b'      ,'\b'      ,'\b'    ,'\b'    , 0x7f      , 0x7f      },
    00277     {VK_CANCEL    , 0       ,0x03      ,0x03      ,0x03    ,0x03    , 0x03      , 0x03      },
    00278     {VK_ESCAPE    , 0       ,0x1b      ,0x1b      ,0x1b    ,0x1b    , 0x1b      , 0x1b      },
    00279     {VK_OEM_4     , KANALOK ,'['       ,'{'       ,WCH_SVS ,WCH_OB  , 0x1b      , 0x1b      },
    00280     {VK_OEM_5     , KANALOK ,'\\'      ,'|'       ,WCH_PS  ,WCH_PS  , 0x1c      , 0x1c      },
    00281     {VK_OEM_102   , KANALOK ,WCH_NONE  ,'_'       ,WCH_RO  ,WCH_RO  , 0x1c      , 0x1c      },  // LK411 modified
    00282     {VK_OEM_6     , KANALOK ,']'       ,'}'       ,WCH_MU  ,WCH_CB  , 0x1d      , 0x1d      },
    00283     {VK_RETURN    , 0       ,'\r'      ,'\r'      ,'\r'    ,'\r'    , '\n'      , '\n'      },
    00284     {VK_SPACE     , 0       ,' '       ,' '       ,' '     ,' '     , 0x20      , 0x20      },
    00285     {0            , 0       ,0         ,0         ,0       ,0       , 0         , 0         }
    00286 };
    00287
    00288
    00289 static ALLOC_SECTION_LDATA VK_TO_WCHARS8 aVkToWch8[] = {
    00290     //                      |          |   SHIFT  |  KANA  | K+SHFT |  CONTROL  |  K+CTRL   | SHFT+CTRL |K+SHFT+CTRL|
    00291     //                      |          |==========|========|========|===========|===========|===========|===========|
    00292     {'2'          , KANALOK ,'2'       ,'"'       ,WCH_HU  ,WCH_HU  , WCH_NONE  , WCH_NONE  , 0x00      , 0x00      },
    00293     {'6'          , KANALOK ,'6'       ,'&'       ,WCH_O   ,WCH_OO  , WCH_NONE  , WCH_NONE  , 0x1e      , 0x1e      },
    00294     {VK_OEM_MINUS , KANALOK ,'-'       ,'='       ,WCH_HO  ,WCH_HO  , WCH_NONE  , WCH_NONE  , 0x1f      , 0x1f      },
    00295     {0            , 0       ,0         ,0         ,0       ,0       , 0         , 0         , 0         , 0         }
    00296 };
    00297
    00298
    00299 // Put this last so that VkKeyScan interprets number characters
    00300 // as coming from the main section of the kbd (aVkToWch2 and
    00301 // aVkToWch4) before considering the numpad (aVkToWch1).
    00302 //
    00303 // LK411 doesn't use this table. (Because it doesn't use NUMPAD VK)
    00304
    00305 static ALLOC_SECTION_LDATA VK_TO_WCHARS4 aVkToWch1[] = {
    00306     //                     |          |   SHIFT  |  KANA  | K+SHFT |
    00307     //                     |          |==========|========|========|
    00308     { VK_NUMPAD0   , 0      ,  '0'    , WCH_NONE ,   '0'  ,WCH_NONE},
    00309     { VK_NUMPAD1   , 0      ,  '1'    , WCH_NONE ,   '1'  ,WCH_NONE},
    00310     { VK_NUMPAD2   , 0      ,  '2'    , WCH_NONE ,   '2'  ,WCH_NONE},
    00311     { VK_NUMPAD3   , 0      ,  '3'    , WCH_NONE ,   '3'  ,WCH_NONE},
    00312     { VK_NUMPAD4   , 0      ,  '4'    , WCH_NONE ,   '4'  ,WCH_NONE},
    00313     { VK_NUMPAD5   , 0      ,  '5'    , WCH_NONE ,   '5'  ,WCH_NONE},
    00314     { VK_NUMPAD6   , 0      ,  '6'    , WCH_NONE ,   '6'  ,WCH_NONE},
    00315     { VK_NUMPAD7   , 0      ,  '7'    , WCH_NONE ,   '7'  ,WCH_NONE},
    00316     { VK_NUMPAD8   , 0      ,  '8'    , WCH_NONE ,   '8'  ,WCH_NONE},
    00317     { VK_NUMPAD9   , 0      ,  '9'    , WCH_NONE ,   '9'  ,WCH_NONE},
    00318     { 0            , 0      ,  '\0'   , 0        ,   0    ,0       }   //null terminator
    00319 };
    00320
    00321
    00322 /***************************************************************************\
    00323 * aVkToWcharTable: table of pointers to Character Tables
    00324 *
    00325 * Describes the character tables and the order they should be searched.
    00326 *
    00327 * Note: the order determines the behavior of VkKeyScan() : this function
    00328 *       takes a character and attempts to find a Virtual Key and character-
    00329 *       modifier key combination that produces that character.  The table
    00330 *       containing the numeric keypad (aVkToWch1) must appear last so that
    00331 *       VkKeyScan('0') will be interpreted as one of keys from the main
    00332 *       section, not the numpad.  etc.
    00333 \***************************************************************************/
    00334
    00335 static ALLOC_SECTION_LDATA VK_TO_WCHAR_TABLE aVkToWcharTable[] = {
    00336     {  (PVK_TO_WCHARS1)aVkToWch6, 6, sizeof(aVkToWch6[0]) },
    00337     {  (PVK_TO_WCHARS1)aVkToWch8, 8, sizeof(aVkToWch8[0]) },
    00338     {  (PVK_TO_WCHARS1)aVkToWch4, 4, sizeof(aVkToWch4[0]) },
    00339     {  (PVK_TO_WCHARS1)aVkToWch1, 4, sizeof(aVkToWch1[0]) },  // must come last
    00340     {                       NULL, 0, 0                    }
    00341 };
    00342
    00343
    00344
    00345 /***************************************************************************\
    00346 * aKeyNames[], aKeyNamesExt[]  - Scan Code -> Key Name tables
    00347 *
    00348 * For the GetKeyNameText() API function
    00349 *
    00350 * Tables for non-extended and extended (KBDEXT) keys.
    00351 * (Keys producing printable characters are named by the character itself)
    00352 \***************************************************************************/
    00353
    00354 static ALLOC_SECTION_LDATA VSC_LPWSTR aKeyNames[] = {
    00355     0x01,    L"Esc",
    00356     0x0e,    L"Backspace",
    00357     0x0f,    L"Tab",
    00358     0x1c,    L"Enter",
    00359     0x1d,    L"Ctrl",
    00360 //  0x29,    NULL,              // LK411JJ doesn't use this code
    00361     0x2a,    L"Shift",
    00362     0x36,    L"Right Shift",
    00363     0x37,    L"Num *",
    00364     0x38,    L"Alt",
    00365     0x39,    L"Space",
    00366     0x3a,    L"Caps Lock",
    00367     0x3b,    L"F1",
    00368     0x3c,    L"F2",
    00369     0x3d,    L"F3",
    00370     0x3e,    L"F4",
    00371     0x3f,    L"F5",
    00372     0x40,    L"F6",
    00373     0x41,    L"F7",
    00374     0x42,    L"F8",
    00375     0x43,    L"F9",
    00376     0x44,    L"F10",
    00377     0x45,    L"Num Lock",
    00378     0x46,    L"Scroll Lock",
    00379     0x47,    L"Num 7",
    00380     0x48,    L"Num 8",
    00381     0x49,    L"Num 9",
    00382     0x4a,    L"Num -",
    00383     0x4b,    L"Num 4",
    00384     0x4c,    L"Num 5",
    00385     0x4d,    L"Num 6",
    00386     0x4e,    L"Num +",
    00387     0x4f,    L"Num 1",
    00388     0x50,    L"Num 2",
    00389     0x51,    L"Num 3",
    00390     0x52,    L"Num 0",
    00391     0x53,    L"Num Del",
    00392     0x54,    L"Sys Req",
    00393     0x57,    L"F11",
    00394     0x58,    L"F12",
    00395     0x70,    (LPWSTR)SZ_KEY_NAME_HIRAGANA,
    00396     0x73,    L"_",          // LK411 added
    00397     0x79,    (LPWSTR)SZ_KEY_NAME_HENKAN,
    00398     0x7b,    (LPWSTR)SZ_KEY_NAME_MUHENKAN,
    00399     0x7d,    L"\\",         // LK411 added
    00400     0   ,    NULL
    00401 };
    00402
    00403
    00404 static ALLOC_SECTION_LDATA VSC_LPWSTR aKeyNamesExt[] = {
    00405     0x0f,    (LPWSTR)SZ_KEY_NAME_KANA,  //LK411 added, (@@ check), this macro defined by NEC
    00406     0x1c,    L"Num Enter",
    00407     0x1d,    L"Right Control",
    00408     0x35,    L"Num /",
    00409     0x37,    L"Prnt Scrn",
    00410     0x38,    L"Right Alt",
    00411     0x3d,    L"F13",            // LK411 added
    00412     0x3e,    L"F14",            // LK411 added
    00413     0x3f,    L"F15",            // LK411 added (Help)
    00414     0x40,    L"F16",            // LK411 added (Do)
    00415     0x41,    L"F17",            // LK411 added
    00416 //  0x45,    L"Num Lock",       // LK411 removed
    00417     0x46,    L"Break",
    00418     0x47,    L"Home",
    00419     0x48,    L"Up",
    00420     0x49,    L"Page Up",
    00421     0x4b,    L"Left",
    00422     0x4d,    L"Right",
    00423     0x4e,    L"Num +",          // LK411 modified(same KP,)
    00424     0x4f,    L"End",
    00425     0x50,    L"Down",
    00426     0x51,    L"Page Down",
    00427     0x52,    L"Insert",
    00428     0x53,    L"Delete",
    00429 //  0x54,    L"<00>",           // LK411 removed
    00430 //  0x56,    L"Help",           // LK411 removed
    00431 //  0x5B,    L"Left Windows",       // LK411 removed
    00432 //  0x5C,    L"Right Windows",      // LK411 removed
    00433 //  0x5D,    L"Application",        // LK411 removed
    00434     0   ,    NULL
    00435 };
    00436
    00437
    00438
    00439 static ALLOC_SECTION_LDATA KBDTABLES KbdTables = {
    00440     /*
    00441      * Modifier keys
    00442      */
    00443     &CharModifiers,
    00444
    00445     /*
    00446      * Characters tables
    00447      */
    00448     aVkToWcharTable,
    00449
    00450     /*
    00451      * Diacritics  (none for US English)
    00452      */
    00453     NULL,
    00454
    00455     /*
    00456      * Names of Keys  (no dead keys)
    00457      */
    00458     aKeyNames,
    00459     aKeyNamesExt,
    00460     NULL,
    00461
    00462     /*
    00463      * Scan codes to Virtual Keys
    00464      */
    00465     ausVK,
    00466     sizeof(ausVK) / sizeof(ausVK[0]),
    00467     aE0VscToVk,
    00468     aE1VscToVk,
    00469
    00470     /*
    00471      * No Locale-specific special processing
    00472      */
    00473     0
    00474 };
    00475
    00476
    00477 PKBDTABLES KbdLayerDescriptor(VOID)
    00478 {
    00479     return &KbdTables;
    00480 }
    00481
    00482
    00483
    00484 /***********************************************************************\
    00485 * VkToFuncTable_LK411[]
    00486 *
    00487 \***********************************************************************/
    00488
    00489 static ALLOC_SECTION_LDATA VK_F VkToFuncTable_LK411[] = {
    00490     /* LOCK key */
    00491     {
    00492         VK_CAPITAL,           // Base Vk
    00493         KBDNLS_TYPE_TOGGLE,   // NLSFEProcType
    00494         KBDNLS_INDEX_NORMAL,  // NLSFEProcCurrent
    00495         0x32, /* 0011 0010 */ // NLSFEProcSwitch
    00496         {                     // NLSFEProc
    00497             {KBDNLS_SEND_BASE_VK,0},         // Base
    00498             {KBDNLS_ALPHANUM,0},             // Shift
    00499             {KBDNLS_NOEVENT,0},              // Control
    00500             {KBDNLS_NOEVENT,0},              // Shift+Control
    00501             {KBDNLS_ALPHANUM,0},             // Alt
    00502             {KBDNLS_ALPHANUM,0},             // Shift+Alt
    00503             {KBDNLS_CODEINPUT,0},            // Control+Alt
    00504             {KBDNLS_CODEINPUT,0}             // Shift+Control+Alt
    00505         },
    00506         {                     // NLSFEProcAlt
    00507             {KBDNLS_ALPHANUM,0},             // Base
    00508             {KBDNLS_ALPHANUM,0},             // Shift
    00509             {KBDNLS_NOEVENT,0},              // Control
    00510             {KBDNLS_NOEVENT,0},              // Shift+Control
    00511             {KBDNLS_ALPHANUM,0},             // Alt
    00512             {KBDNLS_ALPHANUM,0},             // Shift+Alt
    00513             {KBDNLS_NOEVENT,0},              // Control+Alt
    00514             {KBDNLS_NOEVENT,0}               // Shift+Control+Alt
    00515         }
    00516     },
    00517
    00518     /* KANA key */
    00519     {
    00520         VK_KANA,              // Base Vk
    00521         KBDNLS_TYPE_TOGGLE,   // NLSFEProcType
    00522         KBDNLS_INDEX_NORMAL,  // NLSFEProcCurrent
    00523         0x08, /* 0000 1000 */ // NLSFEProcSwitch
    00524         {                     // NLSFEProc
    00525             {KBDNLS_SEND_BASE_VK,0},         // Base
    00526             {KBDNLS_NOEVENT,0},              // Shift
    00527             {KBDNLS_NOEVENT,0},              // Control
    00528             {KBDNLS_SEND_PARAM_VK,VK_KANA},  // Shift+Control
    00529             {KBDNLS_NOEVENT,0},              // Alt
    00530             {KBDNLS_NOEVENT,0},              // Shift+Alt
    00531             {KBDNLS_NOEVENT,0},              // Control+Alt
    00532             {KBDNLS_NOEVENT,0}               // Shift+Control+Alt
    00533         },
    00534         {                    // NLSFEProcIndexAlt
    00535             {KBDNLS_SEND_PARAM_VK,VK_KANA},  // Base
    00536             {KBDNLS_SEND_PARAM_VK,VK_KANA},  // Shift
    00537             {KBDNLS_SEND_PARAM_VK,VK_KANA},  // Control
    00538             {KBDNLS_SEND_PARAM_VK,VK_KANA},  // Shift+Control
    00539             {KBDNLS_NOEVENT,0},              // Alt
    00540             {KBDNLS_NOEVENT,0},              // Shift+Alt
    00541             {KBDNLS_NOEVENT,0},              // Control+Alt
    00542             {KBDNLS_NOEVENT,0}               // Shift+Control+Alt
    00543         }
    00544     },
    00545
    00546     /* Hiragana/Katakana key */
    00547     {
    00548         VK_DBE_HIRAGANA,      // Base Vk
    00549         KBDNLS_TYPE_TOGGLE,   // NLSFEProcType
    00550         KBDNLS_INDEX_NORMAL,  // NLSFEProcCurrent
    00551         0x08, /* 0000 1000 */ // NLSFEProcSwitch
    00552         {                     // NLSFEProc
    00553             {KBDNLS_HIRAGANA,0},             // Base
    00554             {KBDNLS_KATAKANA,0},             // Shift
    00555             {KBDNLS_SBCSDBCS,0},             // Control
    00556             {KBDNLS_SEND_PARAM_VK,VK_KANA},  // Shift+Control
    00557             {KBDNLS_ROMAN,0},                // Alt
    00558             {KBDNLS_ROMAN,0},                // Shift+Alt
    00559             {KBDNLS_ROMAN,0},                // Control+Alt
    00560             {KBDNLS_NOEVENT,0}               // Shift+Control+Alt
    00561         },
    00562         {                    // NLSFEProcIndexAlt
    00563             {KBDNLS_SEND_PARAM_VK,VK_KANA},  // Base
    00564             {KBDNLS_SEND_PARAM_VK,VK_KANA},  // Shift
    00565             {KBDNLS_SEND_PARAM_VK,VK_KANA},  // Control
    00566             {KBDNLS_SEND_PARAM_VK,VK_KANA},  // Shift+Control
    00567             {KBDNLS_NOEVENT,0},              // Alt
    00568             {KBDNLS_NOEVENT,0},              // Shift+Alt
    00569             {KBDNLS_NOEVENT,0},              // Control+Alt
    00570             {KBDNLS_NOEVENT,0}               // Shift+Control+Alt
    00571         }
    00572     },
    00573
    00574 #if 0
    00575     // LK411-JJ keyboad doesn't have SBCS/DBCS key.
    00576     /* SBCS/DBCS key */
    00577     {
    00578         VK_DBE_SBCSCHAR,     // Base Vk
    00579         KBDNLS_TYPE_NORMAL,  // NLSFEProcType
    00580         KBDNLS_INDEX_NORMAL, // NLSFEProcCurrent
    00581         0x0,                 // NLSFEProcSwitch
    00582         {                    // NLSFEProc
    00583             {KBDNLS_SBCSDBCS,0},             // Base
    00584             {KBDNLS_SBCSDBCS,0},             // Shift
    00585             {KBDNLS_SBCSDBCS,0},             // Control
    00586             {KBDNLS_SBCSDBCS,0},             // Shift+Control
    00587             {KBDNLS_SEND_PARAM_VK,VK_KANJI}, // Alt
    00588             {KBDNLS_NOEVENT,0},              // Shift+Alt
    00589             {KBDNLS_SEND_PARAM_VK,VK_DBE_ENTERIMECONFIGMODE}, // Control+Alt
    00590             {KBDNLS_SEND_PARAM_VK,VK_DBE_ENTERIMECONFIGMODE}  // Shift+Control+Alt
    00591         },
    00592         {                    // NLSFEProcIndexAlt
    00593             {KBDNLS_NULL,0},  // Base
    00594             {KBDNLS_NULL,0},  // Shift
    00595             {KBDNLS_NULL,0},  // Control
    00596             {KBDNLS_NULL,0},  // Shift+Control
    00597             {KBDNLS_NULL,0},  // Alt
    00598             {KBDNLS_NULL,0},  // Shift+Alt
    00599             {KBDNLS_NULL,0},  // Control+Alt
    00600             {KBDNLS_NULL,0}   // Shift+Control+Alt
    00601         }
    00602     },
    00603 #endif
    00604
    00605     /* CONVERT key */
    00606     {
    00607         VK_CONVERT,           // Base Vk
    00608         KBDNLS_TYPE_NORMAL,   // NLSFEProcType
    00609         KBDNLS_INDEX_NORMAL,  // NLSFEProcCurrent
    00610         0x0,                  // NLSFEProcSwitch
    00611         {                     // NLSFEProc
    00612             {KBDNLS_SEND_BASE_VK,0},         // Base
    00613             {KBDNLS_SEND_BASE_VK,0},         // Shift
    00614             {KBDNLS_NOEVENT,0},              // Control
    00615             {KBDNLS_NOEVENT,0},              // Shift+Control
    00616             {KBDNLS_SEND_PARAM_VK,VK_KANJI}, // Alt
    00617             {KBDNLS_SEND_PARAM_VK,VK_DBE_ENTERIMECONFIGMODE}, // Shift+Alt (LK411: Shift+Alt+NoConv -> IME config)
    00618             {KBDNLS_SEND_PARAM_VK,VK_DBE_ENTERWORDREGISTERMODE}, // Control+Alt
    00619             {KBDNLS_SEND_PARAM_VK,VK_DBE_ENTERWORDREGISTERMODE}  // Shift+Control+Alt
    00620         },
    00621         {                     // NLSFEProcIndexAlt
    00622             {KBDNLS_NULL,0},  // Base
    00623             {KBDNLS_NULL,0},  // Shift
    00624             {KBDNLS_NULL,0},  // Control
    00625             {KBDNLS_NULL,0},  // Shift+Control
    00626             {KBDNLS_NULL,0},  // Alt
    00627             {KBDNLS_NULL,0},  // Shift+Alt
    00628             {KBDNLS_NULL,0},  // Control+Alt
    00629             {KBDNLS_NULL,0}   // Shift+Control+Alt
    00630         }
    00631     },
    00632
    00633     /* NONE-CONVERT key */
    00634     {
    00635         VK_NONCONVERT,       // Base Vk
    00636         KBDNLS_TYPE_NORMAL,  // NLSFEProcType
    00637         KBDNLS_INDEX_NORMAL, // NLSFEProcCurrent
    00638         0x0,                 // NLSFEProcSwitch
    00639         {                    // NLSFEProc
    00640             {KBDNLS_SEND_BASE_VK,0},         // Base
    00641             {KBDNLS_NOEVENT,0},              // Shift
    00642             {KBDNLS_NOEVENT,0},              // Control
    00643             {KBDNLS_NOEVENT,0},              // Shift+Control
    00644             {KBDNLS_SBCSDBCS,0},             // Alt  (LK411: Alt+NoConv -> SBCS/DBCS)
    00645             {KBDNLS_SEND_PARAM_VK,VK_DBE_ENTERIMECONFIGMODE}, // Shift+Alt (LK411: Shift+Alt+NoConv -> IME config)
    00646             {KBDNLS_SEND_PARAM_VK,VK_DBE_ENTERWORDREGISTERMODE}, // Control+Alt
    00647             {KBDNLS_SEND_PARAM_VK,VK_DBE_ENTERWORDREGISTERMODE}  // Shift+Control+Alt
    00648         },
    00649         {                         // NLSFEProcIndexAlt
    00650             {KBDNLS_NULL,0},  // Base
    00651             {KBDNLS_NULL,0},  // Shift
    00652             {KBDNLS_NULL,0},  // Control
    00653             {KBDNLS_NULL,0},  // Shift+Control
    00654             {KBDNLS_NULL,0},  // Alt
    00655             {KBDNLS_NULL,0},  // Shift+Alt
    00656             {KBDNLS_NULL,0},  // Control+Alt
    00657             {KBDNLS_NULL,0}   // Shift+Control+Alt
    00658         }
    00659     }
    00660 };
    00661
    00662
    00663 /***********************************************************************\
    00664 * KbdNlsTables
    00665 *
    00666 \***********************************************************************/
    00667
    00668 static ALLOC_SECTION_LDATA KBDNLSTABLES KbdNlsTables = {
    00669     NLSKBD_OEM_DEC,                      // OEM ID
    00670     NLSKBD_INFO_EMURATE_106_KEYBOARD,    // Information
    00671     5,                                   // Number of VK_F entry
    00672     VkToFuncTable_LK411,                 // Pointer to VK_F array
    00673     0,                                   // Pointer to MouseVk entry
    00674     NULL                                 // Pointer to MouseVk array
    00675 };
    00676
    00677
    00678 PKBDNLSTABLES KbdNlsLayerDescriptor(VOID)
    00679 {
    00680     return &KbdNlsTables;
    00681 }
    00682
    00683 /* EOF */