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

kbd106n.c

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

Generated on Sat May 15 19:40:32 2004 for test by doxygen 1.3.7