Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2073 lines
95 KiB

  1. /****************************** Module Header ******************************\
  2. * Module Name: kbd.h
  3. *
  4. * Copyright (c) 1985-91, Microsoft Corporation
  5. *
  6. * Keyboard table values that form the basis for languages and keyboard types.
  7. * The basis is US, kbd type 4 - all others are a variation on this.
  8. * This file is included by all kbd**.h files.
  9. *
  10. * History:
  11. * 10-Jan-1991 GregoryW
  12. * 23-Apr-1991 IanJa VSC_TO_VK _* macros from oemtab.c
  13. \***************************************************************************/
  14. #ifndef _KBD_
  15. #define _KBD_
  16. /****************************************************************************\
  17. *
  18. * Keyboard Layers. Used in kdb??.dll and in usersrv.dll
  19. *
  20. \****************************************************************************/
  21. /*
  22. * Key Event (KE) structure
  23. * Stores a Virtual Key event
  24. */
  25. typedef struct tagKE {
  26. BYTE bScanCode; // Virtual Scan Code (Set 1)
  27. USHORT usFlaggedVk; // Vk | Flags
  28. } KE, *PKE;
  29. typedef BOOL (* KEPROC)(PKE pKe);
  30. /*
  31. * KE.usFlaggedVk values, also used in the keyboard layer tables.
  32. */
  33. #define KBDEXT (USHORT)0x0100
  34. #define KBDMULTIVK (USHORT)0x0200
  35. #define KBDSPECIAL (USHORT)0x0400
  36. #define KBDNUMPAD (USHORT)0x0800
  37. #define KBDUNICODE (USHORT)0x1000
  38. #define KBDBREAK (USHORT)0x8000
  39. /*
  40. * Key message lParam bits
  41. */
  42. #define EXTENDED_BIT 0x01000000
  43. #define DONTCARE_BIT 0x02000000
  44. #define FAKE_KEYSTROKE 0x02000000
  45. #define ALTNUMPAD_BIT 0x04000000 // copied from windows\inc\wincon.w
  46. /*
  47. * Keyboard Shift State defines. These correspond to the bit mask defined
  48. * by the VkKeyScan() API.
  49. */
  50. #define KBDBASE 0
  51. #define KBDSHIFT 1
  52. #define KBDCTRL 2
  53. #define KBDALT 4
  54. // three symbols KANA, ROYA, LOYA are for FE
  55. #define KBDKANA 8
  56. #define KBDROYA 0x10
  57. #define KBDLOYA 0x20
  58. #define KBDGRPSELTAP 0x80
  59. /*
  60. * Handy diacritics
  61. */
  62. #define GRAVE 0x0300
  63. #define ACUTE 0x0301
  64. #define CIRCUMFLEX 0x0302
  65. #define TILDE 0x0303
  66. #define MACRON 0x0304
  67. #define OVERSCORE 0x0305
  68. #define BREVE 0x0306
  69. #define DOT_ABOVE 0x0307
  70. #define UMLAUT 0x0308
  71. #define DIARESIS UMLAUT
  72. #define HOOK_ABOVE 0x0309
  73. #define RING 0x030A
  74. #define DOUBLE_ACUTE 0x030B
  75. #define HACEK 0x030C
  76. #define CEDILLA 0x0327
  77. #define OGONEK 0x0328
  78. #define TONOS 0x0384
  79. #define DIARESIS_TONOS 0x0385
  80. #define wszGRAVE L"\x0300"
  81. #define wszACUTE L"\x0301"
  82. #define wszCIRCUMFLEX L"\x0302"
  83. #define wszTILDE L"\x0303"
  84. #define wszMACRON L"\x0304"
  85. #define wszOVERSCORE L"\x0305"
  86. #define wszBREVE L"\x0306"
  87. #define wszDOT_ABOVE L"\x0307"
  88. #define wszUMLAUT L"\x0308"
  89. #define wszHOOK_ABOVE L"\x0309"
  90. #define wszRING L"\x030A"
  91. #define wszDOUBLE_ACUTE L"\x030B"
  92. #define wszHACEK L"\x030C"
  93. #define wszCEDILLA L"\x0327"
  94. #define wszOGONEK L"\x0328"
  95. #define wszTONOS L"\x0384"
  96. #define wszDIARESIS_TONOS L"\x0385"
  97. /***************************************************************************\
  98. * MODIFIER KEYS
  99. *
  100. * All keyboards have "Modifier" keys which are used to alter the behaviour of
  101. * some of the other keys. These shifter keys are usually:
  102. * Shift (left and/or right Shift key)
  103. * Ctrl (left and/or right Ctrl key)
  104. * Alt (left and/or right Alt key)
  105. * AltGr (right Alt key only)
  106. *
  107. * NOTE:
  108. * All keyboards use the Shift key.
  109. * All keyboards use a Ctrl key to generate ASCII control characters.
  110. * All keyboards with a number pad use the Alt key and the NumPad to
  111. * generate characters by number.
  112. * Keyboards using AltGr as a Modifier Key usually translate the Virtual
  113. * ScanCode to Virtual Keys VK_CTRL + VK_ALT at input time: the Modifier
  114. * tables should be written to treat Ctrl + Alt as a valid shifter
  115. * key combination in these cases.
  116. *
  117. * By holding down 0 or more of these Modifier keys, a "shift state" is
  118. * obtained : the shift state may affect the translation of Virtual Scancodes
  119. * to Virtual Keys and/or the translation of Virtuals Key to Characters.
  120. *
  121. * EXAMPLES:
  122. *
  123. * Each key on a particular keyboard may be marked with up to five different
  124. * characters in five different positions:
  125. *
  126. * .-------.
  127. * /| |\
  128. * : | 2 4 | :
  129. * | | | |
  130. * | | | |
  131. * | | 1 3 | |
  132. * | |_______| |
  133. * | / \ |
  134. * |/ 5 \|
  135. * `-----------'
  136. *
  137. * A key may also be able to generate a character that is not marked on it:
  138. * these are ASCII Control chars, lower-case letters and/or "invisible keys".
  139. * .-------.
  140. * An example of an "Invisible Key": /| |\
  141. * : | > | :
  142. * The German M24 keyboard 2 should produce the | | | |
  143. * '|' character when ALT SHIFT is is held down | | | |
  144. * while the '<' key (shown here) is pressed: | | < \ | |
  145. * This keyboard has four other invisible | |_______| |
  146. * characters. France, Italy and Spain also | / \ |
  147. * support invisible characters on the M24 |/ \|
  148. * Keyboard 2 with ALT SHIFT depressed. `-----------'
  149. *
  150. * The keyboard table must list the keys that contribute to it's shift state,
  151. * and indicate which combinations are valid. This is done with
  152. * aCharModifiers[] - convert combinations of Modifier Keys to Bitmasks.
  153. * and
  154. * aModification[]; - convert Modifier Bitmasks to enumerated Modifications
  155. *
  156. * AN EXAMPLE OF VALID AND INVALID MODIFIER KEY COMBINATIONS
  157. *
  158. * The US English keyboard has 3 Modifier keys:
  159. * Shift (left or right); Ctrl (left or right); and Alt (left or right).
  160. *
  161. * The only valid combinations of these Modifier Keys are:
  162. * none pressed : Character at position (1) on the key.
  163. * Shift : Character at position (2) on the key.
  164. * Ctrl : Ascii Control characters
  165. * Shift + Ctrl : Ascii Control characters
  166. * Alt : Character-by-number on the numpad
  167. *
  168. * The invalid combinations (that do not generate any characters) are:
  169. * Shift + Alt
  170. * Alt + Ctrl
  171. * Shift + Alt + Ctrl
  172. *
  173. * Something (???) :
  174. * -----------------
  175. * Modifier keys Character produced
  176. * ------------------------- ------------------
  177. * 0 No shifter key depressed position 1
  178. * 1 Shift key is depressed position 2
  179. * 2 AltGr (r.h. Alt) depressed position 4 or 5 (whichever is marked)
  180. *
  181. * However, note that 3 shifter keys (SHIFT, can be combined in a
  182. * characters, depending on the Keyboards
  183. * Consider the following keyboards:
  184. *
  185. * .-------. STRANGE KBD PECULIAR KBD
  186. * /| |\ ================== ==================
  187. * : | 2 4 | : 1 -
  188. * | | | | 2 - SHIFT SHIFT
  189. * | | | | 3 - MENU MENU
  190. * | | 1 3 | | 4 - SHIFT + MENU SHIFT + MENU
  191. * | |_______| | 5 - no such keys CTRL + MENU
  192. * | / \ |
  193. * |/ 5 \|
  194. * `-----------'
  195. * Both STRANGE and PECULIAR keyboards could have aVkToBits[] =
  196. * { VK_SHIFT , KBDSHIFT }, // 0x01
  197. * { VK_CONTROL, KBDCTRL }, // 0x02
  198. * { VK_MENU , KBDALT }, // 0x04
  199. * { 0, 0 }
  200. *
  201. * The STRANGE keyboard has 4 distinct shift states, while the PECULIAR kbd
  202. * has 5. However, note that 3 shifter bits can be combined in a
  203. * total of 2^3 == 8 ways. Each such combination must be related to one (or
  204. * none) of the enumerated shift states.
  205. * Each shifter key combination can be represented by three binary bits:
  206. * Bit 0 is set if VK_SHIFT is down
  207. * Bit 1 is set if VK_CONTROL is down
  208. * Bit 2 is set if VK_MENU is down
  209. *
  210. * Example: If the STRANGE keyboard generates no characters in combination
  211. * when just the ALT key is held down, nor when the SHIFT, CTRL and ALT keys
  212. * are all held down, then the tables might look like this:
  213. *
  214. * VK_MENU,
  215. * VK_CTRL, 0
  216. * };
  217. * aModification[] = {
  218. * 0, // 0 0 0 = 000 <none>
  219. * 1, // 0 0 1 = 001 SHIFT
  220. * SHFT_INVALID, // 0 1 0 = 010 ALT
  221. * 2, // 0 1 1 = 011 SHIFT ALT
  222. * 3, // 1 0 0 = 100 CTRL
  223. * 4, // 1 0 1 = 101 SHIFT CTRL
  224. * 5, // 1 1 0 = 110 CTRL ALT
  225. * SHFT_INVALID // 1 1 1 = 111 SHIFT CTRL ALT
  226. * };
  227. *
  228. *
  229. \***************************************************************************/
  230. /***************************************************************************\
  231. * VK_TO_BIT - associate a Virtual Key with a Modifier bitmask.
  232. *
  233. * Vk - the Virtual key (eg: VK_SHIFT, VK_RMENU, VK_CONTROL etc.)
  234. * Special Values:
  235. * 0 null terminator
  236. * ModBits - a combination of KBDALT, KBDCTRL, KBDSHIFT and kbd-specific bits
  237. * Any kbd-specific shift bits must be the lowest-order bits other
  238. * than KBDSHIFT, KBDCTRL and KBDALT (0, 1 & 2)
  239. *
  240. * Those languages that use AltGr (VK_RMENU) to shift keys convert it to
  241. * CTRL+ALT with the KBDSPECIAL bit in the ausVK[] entry for VK_RMENU
  242. * and by having an entry in aVkToPfnOem[] to simulate the right Vk sequence.
  243. *
  244. \***************************************************************************/
  245. typedef struct {
  246. BYTE Vk;
  247. BYTE ModBits;
  248. } VK_TO_BIT, *PVK_TO_BIT;
  249. /***************************************************************************\
  250. * pModNumber - a table to map shift bits to enumerated shift states
  251. *
  252. * Table attributes: Ordered table
  253. *
  254. * Maps all possible shifter key combinations to an enumerated shift state.
  255. * The size of the table depends on the value of the highest order bit used
  256. * in aCharModifiers[*].ModBits
  257. *
  258. * Special values for aModification[*]
  259. * SHFT_INVALID - no characters produced with this shift state.
  260. LATER: (ianja) no SHFT_CTRL - control characters encoded in tables like others
  261. * SHFT_CTRL - standard control character production (all keyboards must
  262. * be able to produce CTRL-C == 0x0003 etc.)
  263. * Other - enumerated shift state (not less than 0)
  264. *
  265. * This table is indexed by the Modifier Bits to obtain an Modification Number.
  266. *
  267. * CONTROL MENU SHIFT
  268. *
  269. * aModification[] = {
  270. * 0, // 0 0 0 = 000 <none>
  271. * 1, // 0 0 1 = 001 SHIFT
  272. * SHFT_INVALID, // 0 1 0 = 010 ALT
  273. * 2, // 0 1 1 = 011 SHIFT ALT
  274. * 3, // 1 0 0 = 100 CTRL
  275. * 4, // 1 0 1 = 101 SHIFT CTRL
  276. * 5, // 1 1 0 = 110 CTRL ALT
  277. * SHFT_INVALID // 1 1 1 = 111 SHIFT CTRL ALT
  278. * };
  279. *
  280. \***************************************************************************/
  281. typedef struct {
  282. PVK_TO_BIT pVkToBit; // Virtual Keys -> Mod bits
  283. WORD wMaxModBits; // max Modification bit combination value
  284. BYTE ModNumber[]; // Mod bits -> Modification Number
  285. } MODIFIERS, *PMODIFIERS;
  286. WORD GetModifierBits(PMODIFIERS pModifiers, LPBYTE afKeyState);
  287. WORD GetModificationNumber(PMODIFIERS pModifiers, WORD wModBits);
  288. // FE Modifiers_VK
  289. extern PMODIFIERS gpModifiers_VK;
  290. extern MODIFIERS Modifiers_VK_STANDARD;
  291. extern MODIFIERS Modifiers_VK_IBM02;
  292. #define SHFT_INVALID 0x0F
  293. /***************************************************************************\
  294. * apulCvt_VK[] - obtain VK translation table from shift state
  295. * A VK translation table is used to change the value of the Virtual Key
  296. * according to the shift state. OEM only (not locale-specific)
  297. \***************************************************************************/
  298. extern const PULONG *gapulCvt_VK;
  299. extern const ULONG *const gapulCvt_VK_101[];
  300. extern const ULONG *const gapulCvt_VK_84[];
  301. // gapulCvt_VK_IBM02[] is for FE
  302. extern const ULONG *const gapulCvt_VK_IBM02[];
  303. /***************************************************************************\
  304. * awNumPadCvt[] - Translate cursor movement keys to numpad keys
  305. \***************************************************************************/
  306. extern const MODIFIERS Modifiers_VK;
  307. extern BYTE aVkNumpad[];
  308. /***************************************************************************\
  309. * VSC_VK - Associate a Virtual Scancode with a Virtual Key
  310. * Vsc - Virtual Scancode
  311. * Vk - Virtual Key | flags
  312. * Used by VKFromVSC() for scancodes prefixed 0xE0 or 0xE1
  313. \***************************************************************************/
  314. typedef struct _VSC_VK {
  315. BYTE Vsc;
  316. USHORT Vk;
  317. } VSC_VK, *PVSC_VK;
  318. /***************************************************************************\
  319. * VK_VSC - Associate a Virtual Key with a Virtual Scancode
  320. * Vk - Virtual Key
  321. * Vsc - Virtual Scancode
  322. * Used by MapVirtualKey for Virtual Keys not appearing in ausVK[]
  323. \***************************************************************************/
  324. typedef struct _VK_VSC {
  325. BYTE Vk;
  326. BYTE Vsc;
  327. } VK_VSC, *PVK_VSC;
  328. /***************************************************************************\
  329. *
  330. * VK_TO_WCHARS<n> - Associate a Virtual Key with <n> UNICODE characters
  331. *
  332. * VirtualKey - The Virtual Key.
  333. * wch[] - An array of characters, one for each shift state that
  334. * applies to the specified Virtual Key.
  335. *
  336. * Special values for VirtualKey:
  337. * -1 - This entry contains dead chars for the previous entry
  338. * 0 - Terminates a VK_TO_WCHARS[] table
  339. *
  340. * Special values for Attributes:
  341. * CAPLOK - The CAPS-LOCK key affects this key like SHIFT
  342. * SGCAPS - CapsLock uppercases the unshifted char (Swiss-German)
  343. *
  344. * Special values for wch[*]:
  345. * WCH_NONE - No character is generated by pressing this key with the
  346. * current shift state.
  347. * WCH_DEAD - The character is a dead-key: the next VK_TO_WCHARS[] entry
  348. * will contain the values of the dead characters (diaresis)
  349. * that can be produced by the Virtual Key.
  350. * WCH_LGTR - The character is a ligature. The characters generated by
  351. * this keystroke are found in the ligature table.
  352. *
  353. \***************************************************************************/
  354. #define WCH_NONE 0xF000
  355. #define WCH_DEAD 0xF001
  356. #define WCH_LGTR 0xF002
  357. #define CAPLOK 0x01
  358. #define SGCAPS 0x02
  359. #define CAPLOKALTGR 0x04
  360. // KANALOK is for FE
  361. #define KANALOK 0x08
  362. #define GRPSELTAP 0x80
  363. /*
  364. * Macro for VK to WCHAR with "n" shift states
  365. */
  366. #define TYPEDEF_VK_TO_WCHARS(n) typedef struct _VK_TO_WCHARS##n { \
  367. BYTE VirtualKey; \
  368. BYTE Attributes; \
  369. WCHAR wch[n]; \
  370. } VK_TO_WCHARS##n, *PVK_TO_WCHARS##n;
  371. /*
  372. * To facilitate coding the table scanning routine.
  373. */
  374. /*
  375. * Table element types (for various numbers of shift states), used
  376. * to facilitate static initializations of tables.
  377. * VK_TO_WCHARS1 and PVK_TO_WCHARS1 may be used as the generic type
  378. */
  379. TYPEDEF_VK_TO_WCHARS(1) // VK_TO_WCHARS1, *PVK_TO_WCHARS1;
  380. TYPEDEF_VK_TO_WCHARS(2) // VK_TO_WCHARS2, *PVK_TO_WCHARS2;
  381. TYPEDEF_VK_TO_WCHARS(3) // VK_TO_WCHARS3, *PVK_TO_WCHARS3;
  382. TYPEDEF_VK_TO_WCHARS(4) // VK_TO_WCHARS4, *PVK_TO_WCHARS4;
  383. TYPEDEF_VK_TO_WCHARS(5) // VK_TO_WCHARS5, *PVK_TO_WCHARS5;
  384. TYPEDEF_VK_TO_WCHARS(6) // VK_TO_WCHARS6, *PVK_TO_WCHARS5;
  385. TYPEDEF_VK_TO_WCHARS(7) // VK_TO_WCHARS7, *PVK_TO_WCHARS7;
  386. // these three (8,9,10) are for FE
  387. TYPEDEF_VK_TO_WCHARS(8) // VK_TO_WCHARS8, *PVK_TO_WCHARS8;
  388. TYPEDEF_VK_TO_WCHARS(9) // VK_TO_WCHARS9, *PVK_TO_WCHARS9;
  389. TYPEDEF_VK_TO_WCHARS(10) // VK_TO_WCHARS10, *PVK_TO_WCHARS10;
  390. /***************************************************************************\
  391. *
  392. * VK_TO_WCHAR_TABLE - Describe a table of VK_TO_WCHARS1
  393. *
  394. * pVkToWchars - points to the table.
  395. * nModifications - the number of shift-states supported by this table.
  396. * (this is the number of elements in pVkToWchars[*].wch[])
  397. *
  398. * A keyboard may have several such tables: all keys with the same number of
  399. * shift-states are grouped together in one table.
  400. *
  401. * Special values for pVktoWchars:
  402. * NULL - Terminates a VK_TO_WCHAR_TABLE[] list.
  403. *
  404. \***************************************************************************/
  405. typedef struct _VK_TO_WCHAR_TABLE {
  406. PVK_TO_WCHARS1 pVkToWchars;
  407. BYTE nModifications;
  408. BYTE cbSize;
  409. } VK_TO_WCHAR_TABLE, *PVK_TO_WCHAR_TABLE;
  410. /***************************************************************************\
  411. *
  412. * Dead Key (diaresis) tables
  413. *
  414. * LATER IanJa: supplant by an NLS API that composes Diacritic+Base -> WCHAR
  415. *
  416. \***************************************************************************/
  417. typedef struct {
  418. DWORD dwBoth; // diacritic & char
  419. WCHAR wchComposed;
  420. USHORT uFlags;
  421. } DEADKEY, *PDEADKEY;
  422. #define DEADTRANS(ch, accent, comp, flags) { MAKELONG(ch, accent), comp, flags}
  423. /*
  424. * Bit values for uFlags
  425. */
  426. #define DKF_DEAD 0x0001
  427. /***************************************************************************\
  428. *
  429. * Ligature table
  430. *
  431. \***************************************************************************/
  432. /*
  433. * Macro for ligature with "n" characters
  434. */
  435. #define TYPEDEF_LIGATURE(n) typedef struct _LIGATURE##n { \
  436. BYTE VirtualKey; \
  437. WORD ModificationNumber; \
  438. WCHAR wch[n]; \
  439. } LIGATURE##n, *PLIGATURE##n;
  440. /*
  441. * To facilitate coding the table scanning routine.
  442. */
  443. /*
  444. * Table element types (for various numbers of ligatures), used
  445. * to facilitate static initializations of tables.
  446. *
  447. * LIGATURE1 and PLIGATURE1 are used as the generic type
  448. */
  449. TYPEDEF_LIGATURE(1) // LIGATURE1, *PLIGATURE1;
  450. TYPEDEF_LIGATURE(2) // LIGATURE2, *PLIGATURE2;
  451. TYPEDEF_LIGATURE(3) // LIGATURE3, *PLIGATURE3;
  452. TYPEDEF_LIGATURE(4) // LIGATURE4, *PLIGATURE4;
  453. TYPEDEF_LIGATURE(5) // LIGATURE5, *PLIGATURE5;
  454. /***************************************************************************\
  455. * VSC_LPWSTR - associate a Virtual Scancode with a Text string
  456. *
  457. * Uses:
  458. * GetKeyNameText(), aKeyNames[] Map virtual scancode to name of key
  459. *
  460. \***************************************************************************/
  461. typedef struct {
  462. BYTE vsc;
  463. LPWSTR pwsz;
  464. } VSC_LPWSTR, *PVSC_LPWSTR;
  465. /*
  466. * Along with ligature support we're adding a proper version number.
  467. * The previous version number (actually just unused bits...) was
  468. * always zero. The version number will live in the high word of
  469. * fLocaleFlags.
  470. */
  471. #define KBD_VERSION 1
  472. #define GET_KBD_VERSION(p) (HIWORD((p)->fLocaleFlags))
  473. /*
  474. * Attributes such as AltGr, LRM_RLM, ShiftLock are stored in the the low word
  475. * of fLocaleFlags (layout specific) or in gdwKeyboardAttributes (all layouts)
  476. */
  477. #define KLLF_ALTGR 0x0001
  478. #define KLLF_SHIFTLOCK 0x0002
  479. #define KLLF_LRM_RLM 0x0004
  480. /*
  481. * Some attributes are per-layout (specific to an individual layout), some
  482. * attributes are per-user (apply globally to all layouts). Some are both.
  483. */
  484. #define KLLF_LAYOUT_ATTRS (KLLF_SHIFTLOCK | KLLF_ALTGR | KLLF_LRM_RLM)
  485. #define KLLF_GLOBAL_ATTRS (KLLF_SHIFTLOCK)
  486. /*
  487. * Flags passed in to the KeyboardLayout API (KLF_*) as can be converted to
  488. * internal (KLLF_*) attributes:
  489. */
  490. #define KLL_ATTR_FROM_KLF(x) ((x) >> 15)
  491. #define KLL_LAYOUT_ATTR_FROM_KLF(x) (KLL_ATTR_FROM_KLF(x) & KLLF_LAYOUT_ATTRS)
  492. #define KLL_GLOBAL_ATTR_FROM_KLF(x) (KLL_ATTR_FROM_KLF(x) & KLLF_GLOBAL_ATTRS)
  493. #ifdef _WINUSERP_
  494. /*
  495. * If we have included winuserp.h, we can check our KLLF_* values
  496. */
  497. #if KLLF_SHIFTLOCK != KLL_ATTR_FROM_KLF(KLF_SHIFTLOCK)
  498. #error KLLF_SHIFTLOCK != KLL_ATTR_FROM_KLF(KLF_SHIFTLOCK)
  499. #endif
  500. #if KLLF_LRM_RLM != KLL_ATTR_FROM_KLF(KLF_LRM_RLM)
  501. #error KLLF_LRM_RLM != KLL_ATTR_FROM_KLF(KLF_LRM_RLM)
  502. #endif
  503. #endif // _WINUSERP_
  504. /***************************************************************************\
  505. * KBDTABLES
  506. *
  507. * This structure describes all the tables that implement the keyboard layer.
  508. *
  509. * When switching to a new layer, we get a new KBDTABLES structure: all key
  510. * processing tables are accessed indirectly through this structure.
  511. *
  512. \***************************************************************************/
  513. typedef struct tagKbdLayer {
  514. /*
  515. * Modifier keys
  516. */
  517. PMODIFIERS pCharModifiers;
  518. /*
  519. * Characters
  520. */
  521. VK_TO_WCHAR_TABLE *pVkToWcharTable; // ptr to tbl of ptrs to tbl
  522. /*
  523. * Diacritics
  524. */
  525. PDEADKEY pDeadKey;
  526. /*
  527. * Names of Keys
  528. */
  529. VSC_LPWSTR *pKeyNames;
  530. VSC_LPWSTR *pKeyNamesExt;
  531. LPWSTR *pKeyNamesDead;
  532. /*
  533. * Scan codes to Virtual Keys
  534. */
  535. USHORT *pusVSCtoVK;
  536. BYTE bMaxVSCtoVK;
  537. PVSC_VK pVSCtoVK_E0; // Scancode has E0 prefix
  538. PVSC_VK pVSCtoVK_E1; // Scancode has E1 prefix
  539. /*
  540. * Locale-specific special processing
  541. */
  542. DWORD fLocaleFlags;
  543. /*
  544. * Ligatures
  545. */
  546. BYTE nLgMax;
  547. BYTE cbLgEntry;
  548. PLIGATURE1 pLigature;
  549. } KBDTABLES, *PKBDTABLES;
  550. /*
  551. * OEM-specific special processing (keystroke simulators and filters)
  552. */
  553. extern KEPROC aKEProcOEM[];
  554. /*
  555. * FarEast-specific special...
  556. */
  557. typedef struct _VK_FUNCTION_PARAM {
  558. BYTE NLSFEProcIndex;
  559. ULONG NLSFEProcParam;
  560. } VK_FPARAM, *PVK_FPARAM;
  561. typedef struct _VK_TO_FUNCTION_TABLE {
  562. BYTE Vk;
  563. BYTE NLSFEProcType;
  564. BYTE NLSFEProcCurrent;
  565. // Index[0] : Base
  566. // Index[1] : Shift
  567. // Index[2] : Control
  568. // Index[3] : Shift+Control
  569. // Index[4] : Alt
  570. // Index[5] : Shift+Alt
  571. // Index[6] : Control+Alt
  572. // Index[7] : Shift+Control+Alt
  573. BYTE NLSFEProcSwitch; // 8 bits
  574. VK_FPARAM NLSFEProc[8];
  575. VK_FPARAM NLSFEProcAlt[8];
  576. } VK_F, *PVK_F;
  577. typedef struct tagKbdNlsLayer {
  578. USHORT OEMIdentifier;
  579. USHORT LayoutInformation;
  580. UINT NumOfVkToF;
  581. VK_F *pVkToF;
  582. //
  583. // The pusMouseVKey array provides a translation from the virtual key
  584. // value to an index. The index is used to select the appropriate
  585. // routine to process the virtual key, as well as to select extra
  586. // information that is used by this routine during its processing.
  587. // If this value is NULL, following default will be used.
  588. //
  589. // ausMouseVKey[] = {
  590. // VK_CLEAR, // Numpad 5: Click active button
  591. // VK_PRIOR, // Numpad 9: Up & Right
  592. // VK_NEXT, // Numpad 3: Down & Right
  593. // VK_END, // Numpad 1: Down & Left
  594. // VK_HOME, // Numpad 7: Up & Left
  595. // VK_LEFT, // Numpad 4: Left
  596. // VK_UP, // Numpad 8: Up
  597. // VK_RIGHT, // Numpad 6: Right
  598. // VK_DOWN, // Numpad 2: Down
  599. // VK_INSERT, // Numpad 0: Active button down
  600. // VK_DELETE, // Numpad .: Active button up
  601. // VK_MULTIPLY, // Numpad *: Select both buttons
  602. // VK_ADD, // Numpad +: Double click active button
  603. // VK_SUBTRACT, // Numpad -: Select right button
  604. // VK_DEVIDE|KBDEXT, // Numpad /: Select left button
  605. // VK_NUMLOCK|KBDEXT}; // Num Lock
  606. //
  607. INT NumOfMouseVKey;
  608. USHORT *pusMouseVKey;
  609. } KBDNLSTABLES, *PKBDNLSTABLES;
  610. //
  611. // OEM Ids - KBDNLSTABLES.OEMIdentifier
  612. //
  613. // PSS ID Number: Q130054
  614. // Article last modified on 05-16-1995
  615. //
  616. // 3.10 1.20 | 3.50 1.20
  617. // WINDOWS | WINDOWS NT
  618. //
  619. // ---------------------------------------------------------------------
  620. // The information in this article applies to:
  621. // - Microsoft Windows Software Development Kit (SDK) for Windows
  622. // version 3.1
  623. // - Microsoft Win32 Software Development Kit (SDK) version 3.5
  624. // - Microsoft Win32s version 1.2
  625. // ---------------------------------------------------------------------
  626. // SUMMARY
  627. // =======
  628. // Because of the variety of computer manufacturers (NEC, Fujitsu, IBMJ, and
  629. // so on) in Japan, sometimes Windows-based applications need to know which
  630. // OEM (original equipment manufacturer) manufactured the computer that is
  631. // running the application. This article explains how.
  632. //
  633. // MORE INFORMATION
  634. // ================
  635. // There is no documented way to detect the manufacturer of the computer that
  636. // is currently running an application. However, a Windows-based application
  637. // can detect the type of OEM Windows by using the return value of the
  638. // GetKeyboardType() function.
  639. //
  640. // If an application uses the GetKeyboardType API, it can get OEM ID by
  641. // specifying "1" (keyboard subtype) as argument of the function. Each OEM ID
  642. // is listed here:
  643. //
  644. // OEM Windows OEM ID
  645. // ------------------------------
  646. // Microsoft 00H (DOS/V)
  647. // all AX 01H
  648. // EPSON 04H
  649. // Fujitsu 05H
  650. // IBMJ 07H
  651. // Matsushita 0AH
  652. // NEC 0DH
  653. // Toshiba 12H
  654. //
  655. // Application programs can use these OEM IDs to distinguish the type of OEM
  656. // Windows. Note, however, that this method is not documented, so Microsoft
  657. // may not support it in the future version of Windows.
  658. //
  659. // As a rule, application developers should write hardware-independent code,
  660. // especially when making Windows-based applications. If they need to make a
  661. // hardware-dependent application, they must prepare the separated program
  662. // file for each different hardware architecture.
  663. //
  664. // Additional reference words: 3.10 1.20 3.50 1.20 kbinf
  665. // KBCategory: kbhw
  666. // KBSubcategory: wintldev
  667. // =============================================================================
  668. // Copyright Microsoft Corporation 1995.
  669. //
  670. #define NLSKBD_OEM_MICROSOFT 0x00
  671. #define NLSKBD_OEM_AX 0x01
  672. #define NLSKBD_OEM_EPSON 0x04
  673. #define NLSKBD_OEM_FUJITSU 0x05
  674. #define NLSKBD_OEM_IBM 0x07
  675. #define NLSKBD_OEM_MATSUSHITA 0x0A
  676. #define NLSKBD_OEM_NEC 0x0D
  677. #define NLSKBD_OEM_TOSHIBA 0x12
  678. #define NLSKBD_OEM_DEC 0x18 // only NT
  679. //
  680. // Microsoft (default) - keyboards hardware/layout
  681. //
  682. #define MICROSOFT_KBD_101_TYPE 0
  683. #define MICROSOFT_KBD_AX_TYPE 1
  684. #define MICROSOFT_KBD_106_TYPE 2
  685. #define MICROSOFT_KBD_002_TYPE 3
  686. #define MICROSOFT_KBD_001_TYPE 4
  687. #define MICROSOFT_KBD_FUNC 12
  688. //
  689. // AX consortium - keyboards hardware/layout
  690. //
  691. #define AX_KBD_DESKTOP_TYPE 1
  692. //
  693. // Fujitsu - keyboards hardware/layout
  694. //
  695. #define FMR_KBD_JIS_TYPE 0
  696. #define FMR_KBD_OASYS_TYPE 1
  697. #define FMV_KBD_OASYS_TYPE 2
  698. //
  699. // NEC - keyboards hardware/layout
  700. //
  701. #define NEC_KBD_NORMAL_TYPE 1
  702. #define NEC_KBD_N_MODE_TYPE 2
  703. #define NEC_KBD_H_MODE_TYPE 3
  704. #define NEC_KBD_LAPTOP_TYPE 4
  705. #define NEC_KBD_106_TYPE 5
  706. //
  707. // Toshiba - keyboards hardware/layout
  708. //
  709. #define TOSHIBA_KBD_DESKTOP_TYPE 13
  710. #define TOSHIBA_KBD_LAPTOP_TYPE 15
  711. //
  712. // DEC - keyboards hardware/layout
  713. //
  714. #define DEC_KBD_ANSI_LAYOUT_TYPE 1 // only NT
  715. #define DEC_KBD_JIS_LAYOUT_TYPE 2 // only NT
  716. //
  717. // Keyboard layout information - KBDNLSTABLE.LayoutInformation
  718. //
  719. //
  720. // If this flag is on, System sends notification to keyboard
  721. // drivers (leyout/kernel mode). when IME (Input-Mehod-Editor)
  722. // status become changed.
  723. //
  724. #define NLSKBD_INFO_SEND_IME_NOTIFICATION 0x0001
  725. //
  726. // If this flag is on, System will use VK_HOME/VK_KANA instead of
  727. // VK_NUMLOCK/VK_OEM_SCROLL for Accessibility toggle keys.
  728. // + Typically, NEC PC-9800 Series will use this bit, because
  729. // they does not have 'NumLock' and 'ScrollLock' keys.
  730. //
  731. #define NLSKBD_INFO_ACCESSIBILITY_KEYMAP 0x0002
  732. //
  733. // If this flag is on, System will return 101 or 106 Japanese
  734. // keyboard type/subtype id, when GetKeyboardType() is called.
  735. //
  736. #define NLSKBD_INFO_EMURATE_101_KEYBOARD 0x0010
  737. #define NLSKBD_INFO_EMURATE_106_KEYBOARD 0x0020
  738. //
  739. // Keyboard layout function types
  740. //
  741. // - VK_F.NLSFEProcType
  742. //
  743. #define KBDNLS_TYPE_NULL 0
  744. #define KBDNLS_TYPE_NORMAL 1
  745. #define KBDNLS_TYPE_TOGGLE 2
  746. //
  747. // - VK_F.NLSFEProcCurrent
  748. //
  749. #define KBDNLS_INDEX_NORMAL 1
  750. #define KBDNLS_INDEX_ALT 2
  751. //
  752. // - VK_F.NLSFEProc[]
  753. //
  754. #define KBDNLS_NULL 0 // Invalid function
  755. #define KBDNLS_NOEVENT 1 // Drop keyevent
  756. #define KBDNLS_SEND_BASE_VK 2 // Send Base VK_xxx
  757. #define KBDNLS_SEND_PARAM_VK 3 // Send Parameter VK_xxx
  758. #define KBDNLS_KANALOCK 4 // VK_KANA (with hardware lock)
  759. #define KBDNLS_ALPHANUM 5 // VK_DBE_ALPHANUMERIC
  760. #define KBDNLS_HIRAGANA 6 // VK_DBE_HIRAGANA
  761. #define KBDNLS_KATAKANA 7 // VK_DBE_KATAKANA
  762. #define KBDNLS_SBCSDBCS 8 // VK_DBE_SBCSCHAR/VK_DBE_DBCSCHAR
  763. #define KBDNLS_ROMAN 9 // VK_DBE_ROMAN/VK_DBE_NOROMAN
  764. #define KBDNLS_CODEINPUT 10 // VK_DBE_CODEINPUT/VK_DBE_NOCODEINPUT
  765. #define KBDNLS_HELP_OR_END 11 // VK_HELP or VK_END [NEC PC-9800 Only]
  766. #define KBDNLS_HOME_OR_CLEAR 12 // VK_HOME or VK_CLEAR [NEC PC-9800 Only]
  767. #define KBDNLS_NUMPAD 13 // VK_NUMPAD? for Numpad key [NEC PC-9800 Only]
  768. #define KBDNLS_KANAEVENT 14 // VK_KANA [Fujitsu FMV oyayubi Only]
  769. #define KBDNLS_CONV_OR_NONCONV 15 // VK_CONVERT and VK_NONCONVERT [Fujitsu FMV oyayubi Only]
  770. typedef BOOL (* NLSKEPROC)(PKE pKe, ULONG dwExtraInfo, ULONG dwParam);
  771. typedef BOOL (* NLSVKFPROC)(PVK_F pVkToF, PKE pKe, ULONG dwExtraInfo);
  772. //
  773. // Keyboard Type = 7 : Japanese Keyboard
  774. // Keyboard Type = 8 : Korean Keyboard
  775. //
  776. #define JAPANESE_KEYBOARD(Id) ((Id).Type == 7)
  777. #define KOREAN_KEYBOARD(Id) ((Id).Type == 8)
  778. #define JAPANESE_KBD_LAYOUT(hkl) ((LOBYTE(LOWORD(HandleToUlong(hkl)))) == LANG_JAPANESE)
  779. #define KOREAN_KBD_LAYOUT(hkl) ((LOBYTE(LOWORD(HandleToUlong(hkl)))) == LANG_KOREAN)
  780. //
  781. // NLS Keyboard functions
  782. //
  783. VOID NlsKbdInitializePerSystem(VOID);
  784. VOID NlsKbdSendIMENotification(DWORD dwImeOpen, DWORD dwImeConversion);
  785. // end of FE specific
  786. /***************************************************************************\
  787. * Macros for ausVK[] values (used below)
  788. *
  789. * These macros prefix each argument with VK_ to produce the name of a Virtual
  790. * Key defined in "winuser.h" (eg: ESCAPE becomes VK_ESCAPE).
  791. \***************************************************************************/
  792. #ifndef KBD_TYPE
  793. #define KBD_TYPE 4
  794. #endif
  795. /*
  796. * _NE() selects the Virtual Key according to keyboard type
  797. */
  798. #if (KBD_TYPE == 1)
  799. #define _NE(v1,v2,v3,v4,v5,v6) (VK_##v1)
  800. #elif (KBD_TYPE == 2)
  801. #define _NE(v1,v2,v3,v4,v5,v6) (VK_##v2)
  802. #elif (KBD_TYPE == 3)
  803. #define _NE(v1,v2,v3,v4,v5,v6) (VK_##v3)
  804. #elif (KBD_TYPE == 4)
  805. #define _NE(v1,v2,v3,v4,v5,v6) (VK_##v4)
  806. #elif (KBD_TYPE == 5)
  807. #define _NE(v1,v2,v3,v4,v5,v6) (VK_##v5)
  808. #elif (KBD_TYPE == 6)
  809. #define _NE(v1,v2,v3,v4,v5,v6) (VK_##v6)
  810. #elif (KBD_TYPE == 7)
  811. #define _NE(v7,v8,v16,v10,v11,v12,v13) (VK_##v7)
  812. #elif (KBD_TYPE == 8)
  813. #define _NE(v7,v8,v16,v10,v11,v12,v13) (VK_##v8)
  814. #elif (KBD_TYPE == 10)
  815. #define _NE(v7,v8,v16,v10,v11,v12,v13) (VK_##v10)
  816. #elif (KBD_TYPE == 11)
  817. #define _NE(v7,v8,v16,v10,v11,v12,v13) (VK_##v11)
  818. #elif (KBD_TYPE == 12)
  819. #define _NE(v7,v8,v16,v10,v11,v12,v13) (VK_##v12)
  820. #elif (KBD_TYPE == 13)
  821. #define _NE(v7,v8,v16,v10,v11,v12,v13) (VK_##v13)
  822. #elif (KBD_TYPE == 16)
  823. #define _NE(v7,v8,v16,v10,v11,v12,v13) (VK_##v16)
  824. #elif (KBD_TYPE == 20)
  825. #define _NE(v20,v21,v22) (VK_##v20)
  826. #elif (KBD_TYPE == 21)
  827. #define _NE(v20,v21,v22) (VK_##v21)
  828. #elif (KBD_TYPE == 22)
  829. #define _NE(v20,v21,v22) (VK_##v22)
  830. #elif (KBD_TYPE == 30)
  831. #define _NE(v30,v33,v34) (VK_##v30)
  832. #elif (KBD_TYPE == 33)
  833. #define _NE(v30,v33,v34) (VK_##v33)
  834. #elif (KBD_TYPE == 34)
  835. #define _NE(v30,v33,v34) (VK_##v34)
  836. #elif (KBD_TYPE == 40)
  837. #define _NE(v40,v41) (VK_##v40)
  838. #elif (KBD_TYPE == 41)
  839. #define _NE(v40,v41) (VK_##v41)
  840. #endif
  841. /*
  842. * _EQ() selects the same Virtual Key for all keyboard types
  843. */
  844. #if (KBD_TYPE <= 6)
  845. #define _EQ( v4 ) (VK_##v4)
  846. #elif (KBD_TYPE >= 7) && (KBD_TYPE <= 16)
  847. #define _EQ( v8 ) (VK_##v8)
  848. #elif (KBD_TYPE > 20) && (KBD_TYPE <= 22)
  849. #define _EQ(v20 ) (VK_##v20)
  850. #elif (KBD_TYPE >= 30) && (KBD_TYPE <= 34)
  851. #define _EQ( v30 ) (VK_##v30)
  852. #elif (KBD_TYPE == 37)
  853. #define _EQ( v37 ) (VK_##v37)
  854. #elif (KBD_TYPE >= 40) && (KBD_TYPE <= 41)
  855. #define _EQ( v40 ) (VK_##v40)
  856. #endif
  857. /*
  858. * A bit of trickery for virtual key names 'A' to 'Z' and '0' to '9' so
  859. * that they are not converted to a VK_* name.
  860. * With this macro, VK_'A' equates to 'A' etc.
  861. */
  862. #define VK_
  863. #define VK__none_ 0xFF
  864. #define VK_ABNT_C1 0xC1
  865. #define VK_ABNT_C2 0xC2
  866. #if (KBD_TYPE <= 6)
  867. /***************************************************************************\
  868. * T** - Values for ausVK[] (Virtual Scan Code to Virtual Key conversion)
  869. *
  870. * These values are for Scancode Set 3 and the USA.
  871. * Other languages substitute their own values where required (files kbd**.h)
  872. *
  873. * Six sets of keyboards are supported, according to KBD_TYPE:
  874. *
  875. * KBD_TYPE Keyboard (examples)
  876. * ======== =======================================================
  877. * 1 AT&T '301' & '302'; Olivetti 83-key; PC-XT 84-key; etc.
  878. * 2 Olivetti M24 102-key
  879. * 3 HP Vectra (DIN); Olivetti 86-key; etc.
  880. * 4 * Enhanced 101/102-key; Olivetti A; etc.
  881. * 5 Nokia (Ericsson) type 5 (1050, etc.)
  882. * 6 Nokia (Ericsson) type 6 (9140)
  883. *
  884. * * If KBD_TYPE is not defined, the default is type 4.
  885. *
  886. * KB3270 comments refers to KB 3270 keyboards in native emulation mode (DIP
  887. * switches all OFF), and the Scancode Map used to convert its scancodes to
  888. * standard scancode set 1.
  889. * KB3270 <= 57 - this entry is reached by mapping from scancode 0x57
  890. * to an arbitrary scancode: the VK is what counts
  891. * KB3270 => HOME - this scancode is mapped to the scancode for VK_HOME
  892. * KB3270 - no mapping involved, a scancode for KB3270 only
  893. *
  894. * _EQ() : all keyboard types have the same virtual key for this scancode
  895. * _NE() : different virtual keys for this scancode, depending on kbd type
  896. *
  897. * +------+ +--------+--------+--------+--------+--------+--------+
  898. * | Scan | | kbd | kbd | kbd | kbd | kbd | kbd |
  899. * | code | | type 1 | type 2 | type 3 | type 4 | type 5 | type 6 |
  900. \****+-------+-+--------+--------+--------+--------+--------+--------+******/
  901. #define T00 _EQ( _none_ )
  902. #define T01 _EQ( ESCAPE )
  903. #define T02 _EQ( '1' )
  904. #define T03 _EQ( '2' )
  905. #define T04 _EQ( '3' )
  906. #define T05 _EQ( '4' )
  907. #define T06 _EQ( '5' )
  908. #define T07 _EQ( '6' )
  909. #define T08 _EQ( '7' )
  910. #define T09 _EQ( '8' )
  911. #define T0A _EQ( '9' )
  912. #define T0B _EQ( '0' )
  913. #define T0C _EQ( OEM_MINUS )
  914. #define T0D _NE(OEM_PLUS,OEM_4, OEM_PLUS,OEM_PLUS,OEM_PLUS,OEM_PLUS)
  915. #define T0E _EQ( BACK )
  916. #define T0F _EQ( TAB )
  917. #define T10 _EQ( 'Q' )
  918. #define T11 _EQ( 'W' )
  919. #define T12 _EQ( 'E' )
  920. #define T13 _EQ( 'R' )
  921. #define T14 _EQ( 'T' )
  922. #define T15 _EQ( 'Y' )
  923. #define T16 _EQ( 'U' )
  924. #define T17 _EQ( 'I' )
  925. #define T18 _EQ( 'O' )
  926. #define T19 _EQ( 'P' )
  927. #define T1A _NE(OEM_4, OEM_6, OEM_4, OEM_4, OEM_4, OEM_4 )
  928. #define T1B _NE(OEM_6, OEM_1, OEM_6, OEM_6, OEM_6, OEM_6 )
  929. #define T1C _EQ( RETURN )
  930. #define T1D _EQ( LCONTROL )
  931. #define T1E _EQ( 'A' )
  932. #define T1F _EQ( 'S' )
  933. #define T20 _EQ( 'D' )
  934. #define T21 _EQ( 'F' )
  935. #define T22 _EQ( 'G' )
  936. #define T23 _EQ( 'H' )
  937. #define T24 _EQ( 'J' )
  938. #define T25 _EQ( 'K' )
  939. #define T26 _EQ( 'L' )
  940. #define T27 _NE(OEM_1, OEM_PLUS,OEM_1, OEM_1, OEM_1, OEM_1 )
  941. #define T28 _NE(OEM_7, OEM_3, OEM_7, OEM_7, OEM_3, OEM_3 )
  942. #define T29 _NE(OEM_3, OEM_7, OEM_3, OEM_3, OEM_7, OEM_7 )
  943. #define T2A _EQ( LSHIFT )
  944. #define T2B _EQ( OEM_5 )
  945. #define T2C _EQ( 'Z' )
  946. #define T2D _EQ( 'X' )
  947. #define T2E _EQ( 'C' )
  948. #define T2F _EQ( 'V' )
  949. #define T30 _EQ( 'B' )
  950. #define T31 _EQ( 'N' )
  951. #define T32 _EQ( 'M' )
  952. #define T33 _EQ( OEM_COMMA )
  953. #define T34 _EQ( OEM_PERIOD )
  954. #define T35 _EQ( OEM_2 )
  955. #define T36 _EQ( RSHIFT )
  956. #define T37 _EQ( MULTIPLY )
  957. #define T38 _EQ( LMENU )
  958. #define T39 _EQ( ' ' )
  959. #define T3A _EQ( CAPITAL )
  960. #define T3B _EQ( F1 )
  961. #define T3C _EQ( F2 )
  962. #define T3D _EQ( F3 )
  963. #define T3E _EQ( F4 )
  964. #define T3F _EQ( F5 )
  965. #define T40 _EQ( F6 )
  966. #define T41 _EQ( F7 )
  967. #define T42 _EQ( F8 )
  968. #define T43 _EQ( F9 )
  969. #define T44 _EQ( F10 )
  970. #define T45 _EQ( NUMLOCK )
  971. #define T46 _EQ( OEM_SCROLL )
  972. #define T47 _EQ( HOME )
  973. #define T48 _EQ( UP )
  974. #define T49 _EQ( PRIOR )
  975. #define T4A _EQ( SUBTRACT )
  976. #define T4B _EQ( LEFT )
  977. #define T4C _EQ( CLEAR )
  978. #define T4D _EQ( RIGHT )
  979. #define T4E _EQ( ADD )
  980. #define T4F _EQ( END )
  981. #define T50 _EQ( DOWN )
  982. #define T51 _EQ( NEXT )
  983. #define T52 _EQ( INSERT )
  984. #define T53 _EQ( DELETE )
  985. #define T54 _EQ( SNAPSHOT )
  986. #define T55 _EQ( _none_ ) // KB3270 => DOWN
  987. #define T56 _NE(OEM_102, HELP, OEM_102, OEM_102, _none_, OEM_PA2 ) // KB3270 => LEFT
  988. #define T57 _NE(F11, RETURN, F11, F11, _none_, HELP ) // KB3270 => ZOOM
  989. #define T58 _NE(F12, LEFT, F12, F12, _none_, OEM_102 ) // KB3270 => HELP
  990. #define T59 _EQ( CLEAR )
  991. #define T5A _EQ( OEM_WSCTRL )// WSCtrl
  992. #define T5B _EQ( OEM_FINISH )// Finish
  993. #define T5C _EQ( OEM_JUMP )// Jump
  994. #define T5D _EQ( EREOF )
  995. #define T5E _EQ( OEM_BACKTAB ) // KB3270 <= 7E
  996. #define T5F _EQ( OEM_AUTO ) // KB3270
  997. #define T60 _EQ( _none_ )
  998. #define T61 _EQ( _none_ )
  999. #define T62 _EQ( ZOOM ) // KB3270 <= 57
  1000. #define T63 _EQ( HELP ) // KB3270 <= 58
  1001. #define T64 _EQ( F13 )
  1002. #define T65 _EQ( F14 )
  1003. #define T66 _EQ( F15 )
  1004. #define T67 _EQ( F16 )
  1005. #define T68 _EQ( F17 )
  1006. #define T69 _EQ( F18 )
  1007. #define T6A _EQ( F19 )
  1008. #define T6B _EQ( F20 )
  1009. #define T6C _EQ( F21 )
  1010. #define T6D _EQ( F22 )
  1011. #define T6E _EQ( F23 )
  1012. #define T6F _EQ( OEM_PA3 ) // KB3270
  1013. #define T70 _EQ( _none_ )
  1014. #define T71 _EQ( OEM_RESET ) // KB3270
  1015. #define T72 _EQ( _none_ )
  1016. #define T73 _EQ( ABNT_C1 )
  1017. #define T74 _EQ( _none_ )
  1018. #define T75 _EQ( _none_ ) // KB3270 => RETURN
  1019. #define T76 _EQ( F24 )
  1020. #define T77 _EQ( _none_ ) // KB3270 => HOME
  1021. #define T78 _EQ( _none_ ) // KB3270 => UP
  1022. #define T79 _EQ( _none_ ) // KB3270 => DELETE
  1023. #define T7A _EQ( _none_ ) // KB3270 => INSERT
  1024. #define T7B _EQ( OEM_PA1 ) // KB3270
  1025. #define T7C _EQ( TAB ) // KB3270 => TAB
  1026. #define T7D _EQ( _none_ ) // KB3270 => RIGHT
  1027. #define T7E _EQ( ABNT_C2 ) // KB3270 => BACKTAB
  1028. #define T7F _EQ( OEM_PA2 ) // KB3270
  1029. #define X1C _EQ( RETURN )
  1030. #define X1D _EQ( RCONTROL )
  1031. #define X35 _EQ( DIVIDE )
  1032. #define X37 _EQ( SNAPSHOT )
  1033. #define X38 _EQ( RMENU )
  1034. #define X46 _EQ( CANCEL )
  1035. #define X47 _EQ( HOME )
  1036. #define X48 _EQ( UP )
  1037. #define X49 _EQ( PRIOR )
  1038. #define X4B _EQ( LEFT )
  1039. #define X4D _EQ( RIGHT )
  1040. #define X4F _EQ( END )
  1041. #define X50 _EQ( DOWN )
  1042. #define X51 _NE(NEXT, F1, NEXT, NEXT, _none_, OEM_PA2 )
  1043. #define X52 _EQ( INSERT )
  1044. #define X53 _EQ( DELETE )
  1045. #define X5B _EQ( LWIN )
  1046. #define X5C _EQ( RWIN )
  1047. #define X5D _EQ( APPS )
  1048. #define X5E _EQ( POWER )
  1049. #define X5F _EQ( SLEEP )
  1050. /*
  1051. * The break key is sent to us as E1,LCtrl,NumLock
  1052. * We must convert the E1+LCtrl to BREAK, then ignore the Numlock
  1053. */
  1054. #define Y1D _EQ( PAUSE )
  1055. #elif (KBD_TYPE >= 7) && (KBD_TYPE <= 16)
  1056. /***********************************************************************************\
  1057. * T** - Values for ausVK[] (Virtual Scan Code to Virtual Key conversion)
  1058. *
  1059. * Three sets of keyboards are supported, according to KBD_TYPE:
  1060. *
  1061. * KBD_TYPE Keyboard (examples)
  1062. * ======== =====================================
  1063. * 7 Japanese IBM type 002 keyboard.
  1064. * 8 * Japanese OADG (106) keyboard.
  1065. * 10 Korean 101 (type A) keyboard.
  1066. * 11 Korean 101 (type B) keyboard.
  1067. * 12 Korean 101 (type C) keyboard.
  1068. * 13 Korean 103 keyboard.
  1069. * 16 Japanese AX keyboard.
  1070. *
  1071. * +------+ +----------+----------+----------+----------+----------+----------+----------+
  1072. * | Scan | | kbd | kbd | kbd | kbd | kbd | kbd | kbd |
  1073. * | code | | type 7 | type 8 | type 16 | type 10 | type 11 | type 12 | type 13 |
  1074. \****+-------+-+----------+----------+----------+----------+----------+----------+----------+*/
  1075. #define T00 _EQ( _none_ )
  1076. #define T01 _EQ( ESCAPE )
  1077. #define T02 _EQ( '1' )
  1078. #define T03 _EQ( '2' )
  1079. #define T04 _EQ( '3' )
  1080. #define T05 _EQ( '4' )
  1081. #define T06 _EQ( '5' )
  1082. #define T07 _EQ( '6' )
  1083. #define T08 _EQ( '7' )
  1084. #define T09 _EQ( '8' )
  1085. #define T0A _EQ( '9' )
  1086. #define T0B _EQ( '0' )
  1087. #define T0C _EQ( OEM_MINUS )
  1088. #define T0D _NE(OEM_7, OEM_7, OEM_PLUS, OEM_PLUS, OEM_PLUS, OEM_PLUS, OEM_PLUS )
  1089. #define T0E _EQ( BACK )
  1090. #define T0F _EQ( TAB )
  1091. #define T10 _EQ( 'Q' )
  1092. #define T11 _EQ( 'W' )
  1093. #define T12 _EQ( 'E' )
  1094. #define T13 _EQ( 'R' )
  1095. #define T14 _EQ( 'T' )
  1096. #define T15 _EQ( 'Y' )
  1097. #define T16 _EQ( 'U' )
  1098. #define T17 _EQ( 'I' )
  1099. #define T18 _EQ( 'O' )
  1100. #define T19 _EQ( 'P' )
  1101. #define T1A _NE(OEM_4, OEM_3, OEM_4, OEM_4, OEM_4, OEM_4, OEM_4 )
  1102. #define T1B _NE(OEM_6, OEM_4, OEM_6, OEM_6, OEM_6, OEM_6, OEM_6 )
  1103. #define T1C _EQ( RETURN )
  1104. #define T1D _EQ( LCONTROL )
  1105. #define T1E _EQ( 'A' )
  1106. #define T1F _EQ( 'S' )
  1107. #define T20 _EQ( 'D' )
  1108. #define T21 _EQ( 'F' )
  1109. #define T22 _EQ( 'G' )
  1110. #define T23 _EQ( 'H' )
  1111. #define T24 _EQ( 'J' )
  1112. #define T25 _EQ( 'K' )
  1113. #define T26 _EQ( 'L' )
  1114. #define T27 _NE(OEM_PLUS, OEM_PLUS, OEM_1, OEM_1, OEM_1, OEM_1, OEM_1 )
  1115. #define T28 _NE(OEM_1, OEM_1, OEM_7, OEM_7, OEM_7, OEM_7, OEM_7 )
  1116. #define T29 _NE(OEM_3, DBE_SBCSCHAR,OEM_3, OEM_3, OEM_3, OEM_3, OEM_3 )
  1117. #define T2A _EQ( LSHIFT )
  1118. #define T2B _NE(OEM_5, OEM_6, OEM_5, OEM_5, OEM_5, OEM_5, OEM_5 )
  1119. #define T2C _EQ( 'Z' )
  1120. #define T2D _EQ( 'X' )
  1121. #define T2E _EQ( 'C' )
  1122. #define T2F _EQ( 'V' )
  1123. #define T30 _EQ( 'B' )
  1124. #define T31 _EQ( 'N' )
  1125. #define T32 _EQ( 'M' )
  1126. #define T33 _EQ( OEM_COMMA )
  1127. #define T34 _EQ( OEM_PERIOD )
  1128. #define T35 _EQ( OEM_2 )
  1129. #define T36 _EQ( RSHIFT )
  1130. #define T37 _EQ( MULTIPLY )
  1131. #define T38 _EQ( LMENU )
  1132. #define T39 _EQ( ' ' )
  1133. #define T3A _NE(DBE_ALPHANUMERIC,DBE_ALPHANUMERIC,CAPITAL,CAPITAL,CAPITAL,CAPITAL,CAPITAL )
  1134. #define T3B _EQ( F1 )
  1135. #define T3C _EQ( F2 )
  1136. #define T3D _EQ( F3 )
  1137. #define T3E _EQ( F4 )
  1138. #define T3F _EQ( F5 )
  1139. #define T40 _EQ( F6 )
  1140. #define T41 _EQ( F7 )
  1141. #define T42 _EQ( F8 )
  1142. #define T43 _EQ( F9 )
  1143. #define T44 _EQ( F10 )
  1144. #define T45 _EQ( NUMLOCK )
  1145. #define T46 _EQ( OEM_SCROLL )
  1146. #define T47 _EQ( HOME )
  1147. #define T48 _EQ( UP )
  1148. #define T49 _EQ( PRIOR )
  1149. #define T4A _EQ( SUBTRACT )
  1150. #define T4B _EQ( LEFT )
  1151. #define T4C _EQ( CLEAR )
  1152. #define T4D _EQ( RIGHT )
  1153. #define T4E _EQ( ADD )
  1154. #define T4F _EQ( END )
  1155. #define T50 _EQ( DOWN )
  1156. #define T51 _EQ( NEXT )
  1157. #define T52 _EQ( INSERT )
  1158. #define T53 _EQ( DELETE )
  1159. #define T54 _EQ( SNAPSHOT )
  1160. #define T55 _EQ( _none_ )
  1161. #define T56 _NE(_none_, _none_, OEM_102, OEM_102, OEM_102, OEM_102, OEM_102 )
  1162. #define T57 _EQ( F11 )
  1163. #define T58 _EQ( F12 )
  1164. #define T59 _EQ( CLEAR )
  1165. #define T5A _NE(NONAME, NONAME, NONCONVERT,OEM_WSCTRL,OEM_WSCTRL,OEM_WSCTRL,OEM_WSCTRL)
  1166. #define T5B _NE(NONAME, NONAME, CONVERT, OEM_FINISH,OEM_FINISH,OEM_FINISH,OEM_FINISH)
  1167. #define T5C _NE(NONAME, NONAME, OEM_AX, OEM_JUMP, OEM_JUMP, OEM_JUMP, OEM_JUMP )
  1168. #define T5D _EQ( EREOF )
  1169. #define T5E _NE(_none_, _none_, _none_, OEM_BACKTAB,OEM_BACKTAB,OEM_BACKTAB,OEM_BACKTAB)
  1170. #define T5F _NE(NONAME, NONAME, NONAME, OEM_AUTO, OEM_AUTO, OEM_AUTO, OEM_AUTO )
  1171. #define T60 _EQ( _none_ )
  1172. #define T61 _NE(_none_, _none_, _none_, ZOOM, ZOOM, ZOOM, ZOOM )
  1173. #define T62 _NE(_none_, _none_, _none_, HELP, HELP, HELP, HELP )
  1174. #define T63 _EQ( _none_ )
  1175. #define T64 _EQ( F13 )
  1176. #define T65 _EQ( F14 )
  1177. #define T66 _EQ( F15 )
  1178. #define T67 _EQ( F16 )
  1179. #define T68 _EQ( F17 )
  1180. #define T69 _EQ( F18 )
  1181. #define T6A _EQ( F19 )
  1182. #define T6B _EQ( F20 )
  1183. #define T6C _EQ( F21 )
  1184. #define T6D _EQ( F22 )
  1185. #define T6E _EQ( F23 )
  1186. #define T6F _NE(_none_, _none_, _none_, OEM_PA3, OEM_PA3, OEM_PA3, OEM_PA3 )
  1187. #define T70 _NE(DBE_KATAKANA,DBE_HIRAGANA,_none_,_none_, _none_, _none_, _none_ )
  1188. #define T71 _NE(_none_, _none_, _none_, OEM_RESET, OEM_RESET, OEM_RESET, OEM_RESET )
  1189. #define T72 _EQ( _none_ )
  1190. #define T73 _NE(OEM_102, OEM_102, _none_, ABNT_C1, ABNT_C1, ABNT_C1, ABNT_C1 )
  1191. #define T74 _EQ( _none_ )
  1192. #define T75 _EQ( _none_ )
  1193. #define T76 _EQ( F24 )
  1194. #define T77 _NE(DBE_SBCSCHAR,_none_, _none_, _none_, _none_, _none_, _none_ )
  1195. #define T78 _EQ( _none_ )
  1196. #define T79 _NE(CONVERT, CONVERT, _none_, _none_, _none_, _none_, _none_ )
  1197. #define T7A _EQ( _none_ )
  1198. #define T7B _NE(NONCONVERT,NONCONVERT,_none_, OEM_PA1, OEM_PA1, OEM_PA1, OEM_PA1 )
  1199. #define T7C _EQ( TAB )
  1200. #define T7D _NE(_none_, OEM_5, _none_, _none_, _none_, _none_, _none_ )
  1201. #define T7E _EQ( ABNT_C2 )
  1202. #define T7F _EQ( OEM_PA2 )
  1203. #define X1C _EQ( RETURN )
  1204. #define X1D _NE(RCONTROL, RCONTROL,DBE_KATAKANA,HANJA, HANGEUL, RCONTROL, RCONTROL )
  1205. #define X33 _NE(OEM_8, _none_, _none_, _none_, _none_, _none_, _none_ )
  1206. #define X35 _EQ( DIVIDE )
  1207. #define X37 _EQ( SNAPSHOT )
  1208. #define X38 _NE(DBE_HIRAGANA,RMENU, KANJI, HANGEUL, HANJA, RMENU, RMENU )
  1209. #define X42 _EQ( _none_ )
  1210. #define X43 _EQ( _none_ )
  1211. #define X44 _EQ( _none_ )
  1212. #define X46 _EQ( CANCEL )
  1213. #define X47 _EQ( HOME )
  1214. #define X48 _EQ( UP )
  1215. #define X49 _EQ( PRIOR )
  1216. #define X4B _EQ( LEFT )
  1217. #define X4D _EQ( RIGHT )
  1218. #define X4F _EQ( END )
  1219. #define X50 _EQ( DOWN )
  1220. #define X51 _EQ( NEXT )
  1221. #define X52 _EQ( INSERT )
  1222. #define X53 _EQ( DELETE )
  1223. #define X5B _EQ( LWIN )
  1224. #define X5C _EQ( RWIN )
  1225. #define X5D _EQ( APPS )
  1226. #define X5E _EQ( POWER )
  1227. #define X5F _EQ( SLEEP )
  1228. #define XF1 _NE(_none_, _none_, _none_, HANJA, HANJA, HANJA, HANJA )
  1229. #define XF2 _NE(_none_, _none_, _none_, HANGEUL, HANGEUL, HANGEUL, HANGEUL )
  1230. /*
  1231. * The break key is sent to us as E1,LCtrl,NumLock
  1232. * We must convert the E1+LCtrl to BREAK, then ignore the Numlock
  1233. */
  1234. #define Y1D _EQ( PAUSE )
  1235. #elif (KBD_TYPE > 20) && (KBD_TYPE <= 22)
  1236. /***********************************************************************\
  1237. * T** - Values for ausVK[] (Virtual Scan Code to Virtual Key conversion)
  1238. *
  1239. * Three sets of keyboards are supported, according to KBD_TYPE:
  1240. *
  1241. * KBD_TYPE Keyboard (examples)
  1242. * ======== =====================================
  1243. * 20 Fujitsu FMR JIS keyboard.
  1244. * 21 Fujitsu FMR OYAYUBI keyboard.
  1245. * 22 * Fujitsu FMV OYAYUBI keyboard.
  1246. *
  1247. * +------+ +----------+----------+----------+
  1248. * | Scan | | kbd | kbd | kbd |
  1249. * | code | | type 20 | type 21 | type 22 |
  1250. \****+-------+-+----------+----------+----------+***********************/
  1251. #define T00 _EQ( _none_ )
  1252. #define T01 _EQ( ESCAPE )
  1253. #define T02 _EQ( '1' )
  1254. #define T03 _EQ( '2' )
  1255. #define T04 _EQ( '3' )
  1256. #define T05 _EQ( '4' )
  1257. #define T06 _EQ( '5' )
  1258. #define T07 _EQ( '6' )
  1259. #define T08 _EQ( '7' )
  1260. #define T09 _EQ( '8' )
  1261. #define T0A _EQ( '9' )
  1262. #define T0B _EQ( '0' )
  1263. #define T0C _EQ( OEM_MINUS )
  1264. #define T0D _EQ( OEM_7 )
  1265. #define T0E _NE(OEM_5, OEM_5, BACK )
  1266. #define T0F _NE(BACK, BACK, TAB )
  1267. #define T10 _NE(TAB, TAB, 'Q' )
  1268. #define T11 _NE('Q', 'Q', 'W' )
  1269. #define T12 _NE('W', 'W', 'E' )
  1270. #define T13 _NE('E', 'E', 'R' )
  1271. #define T14 _NE('R', 'R', 'T' )
  1272. #define T15 _NE('T', 'T', 'Y' )
  1273. #define T16 _NE('Y', 'Y', 'U' )
  1274. #define T17 _NE('U', 'U', 'I' )
  1275. #define T18 _NE('I', 'I', 'O' )
  1276. #define T19 _NE('O', 'O', 'P' )
  1277. #define T1A _NE('P', 'P', OEM_3 )
  1278. #define T1B _NE(OEM_3, OEM_3, OEM_4 )
  1279. #define T1C _NE(OEM_4, OEM_4, RETURN )
  1280. #define T1D _NE(RETURN, RETURN, LCONTROL )
  1281. #define T1E _EQ( 'A' )
  1282. #define T1F _EQ( 'S' )
  1283. #define T20 _EQ( 'D' )
  1284. #define T21 _EQ( 'F' )
  1285. #define T22 _EQ( 'G' )
  1286. #define T23 _EQ( 'H' )
  1287. #define T24 _EQ( 'J' )
  1288. #define T25 _EQ( 'K' )
  1289. #define T26 _EQ( 'L' )
  1290. #define T27 _EQ( OEM_PLUS )
  1291. #define T28 _EQ( OEM_1 )
  1292. #define T29 _NE(OEM_6, OEM_6, DBE_SBCSCHAR)
  1293. #define T2A _NE('Z', 'Z', LSHIFT )
  1294. #define T2B _NE('X', 'X', OEM_6 )
  1295. #define T2C _NE('C', 'C', 'Z' )
  1296. #define T2D _NE('V', 'V', 'X' )
  1297. #define T2E _NE('B', 'B', 'C' )
  1298. #define T2F _NE('N', 'N', 'V' )
  1299. #define T30 _NE('M', 'M', 'B' )
  1300. #define T31 _NE(OEM_COMMA, OEM_COMMA, 'N' )
  1301. #define T32 _NE(OEM_PERIOD,OEM_PERIOD,'M' )
  1302. #define T33 _NE(OEM_2, OEM_2, OEM_COMMA )
  1303. #define T34 _NE(OEM_8, OEM_8, OEM_PERIOD)
  1304. #define T35 _NE(' ', ' ', OEM_2 )
  1305. #define T36 _NE(MULTIPLY, MULTIPLY, RSHIFT )
  1306. #define T37 _NE(DIVIDE, DIVIDE, MULTIPLY )
  1307. #define T38 _NE(ADD, ADD, LMENU )
  1308. #define T39 _NE(SUBTRACT, SUBTRACT, ' ' )
  1309. #define T3A _NE(NUMPAD7, NUMPAD7, DBE_ALPHANUMERIC)
  1310. #define T3B _NE(NUMPAD8, NUMPAD8, F1 )
  1311. #define T3C _NE(NUMPAD9, NUMPAD9, F2 )
  1312. #define T3D _NE(EQUAL, EQUAL, F3 )
  1313. #define T3E _NE(NUMPAD4, NUMPAD4, F4 )
  1314. #define T3F _NE(NUMPAD5, NUMPAD5, F5 )
  1315. #define T40 _NE(NUMPAD6, NUMPAD6, F6 )
  1316. #define T41 _NE(SEPARATOR, SEPARATOR, F7 )
  1317. #define T42 _NE(NUMPAD1, NUMPAD1, F8 )
  1318. #define T43 _NE(NUMPAD2, NUMPAD2, F9 )
  1319. #define T44 _NE(NUMPAD3, NUMPAD3, F10 )
  1320. #define T45 _NE(RETURN, RETURN, NUMLOCK )
  1321. #define T46 _NE(NUMPAD0, NUMPAD0, OEM_SCROLL)
  1322. #define T47 _NE(DECIMAL, DECIMAL, HOME )
  1323. #define T48 _NE(INSERT, INSERT, UP )
  1324. #define T49 _NE(OEM_00, OEM_00, PRIOR )
  1325. #define T4A _NE(OEM_000, OEM_000, SUBTRACT )
  1326. #define T4B _NE(DELETE, DELETE, LEFT )
  1327. #define T4C _NE(_none_, _none_, CLEAR )
  1328. #define T4D _NE(UP, UP, RIGHT )
  1329. #define T4E _NE(HOME, HOME, ADD )
  1330. #define T4F _NE(LEFT, LEFT, END )
  1331. #define T50 _EQ( DOWN )
  1332. #define T51 _NE(RIGHT, RIGHT, NEXT )
  1333. #define T52 _NE(LCONTROL, LCONTROL, INSERT )
  1334. #define T53 _NE(LSHIFT, LSHIFT, DELETE )
  1335. #define T54 _NE(_none_, _none_, SNAPSHOT )
  1336. #define T55 _NE(CAPITAL, _none_, _none_ )
  1337. #define T56 _NE(DBE_HIRAGANA,_none_, _none_ )
  1338. #define T57 _NE(NONCONVERT,NONCONVERT,F11 )
  1339. #define T58 _NE(CONVERT, CONVERT, F12 )
  1340. #define T59 _NE(KANJI, KANJI, CLEAR )
  1341. #define T5A _NE(DBE_KATAKANA,_none_, NONAME )
  1342. #define T5B _NE(F12, F12, NONAME )
  1343. #define T5C _NE(LMENU, LMENU, NONAME )
  1344. #define T5D _NE(F1, F1, EREOF )
  1345. #define T5E _NE(F2, F2, _none_ )
  1346. #define T5F _NE(F3, F3, NONAME )
  1347. #define T60 _NE(F4, F4, _none_ )
  1348. #define T61 _NE(F5, F5, _none_ )
  1349. #define T62 _NE(F6, F6, _none_ )
  1350. #define T63 _NE(F7, F7, _none_ )
  1351. #define T64 _NE(F8, F8, F13 )
  1352. #define T65 _NE(F9, F9, F14 )
  1353. #define T66 _NE(F10, F10, F15 )
  1354. #define T67 _NE(_none_, OEM_LOYA, F16 )
  1355. #define T68 _NE(_none_, OEM_ROYA, F17 )
  1356. #define T69 _NE(F11, F11, F18 )
  1357. #define T6A _NE(_none_, DBE_ALPHANUMERIC,F19 )
  1358. #define T6B _NE(OEM_JISHO, OEM_JISHO, F20 )
  1359. #define T6C _NE(OEM_MASSHOU,OEM_MASSHOU,F21 )
  1360. #define T6D _NE(_none_, _none_, F22 )
  1361. #define T6E _NE(PRIOR, PRIOR, F23 )
  1362. #define T6F _NE(_none_, DBE_KATAKANA,_none_ )
  1363. #define T70 _NE(NEXT, NEXT, DBE_HIRAGANA)
  1364. #define T71 _EQ( _none_ )
  1365. #define T72 _NE(CANCEL, CANCEL, _none_ )
  1366. #define T73 _NE(EXECUTE, EXECUTE, OEM_102 )
  1367. #define T74 _NE(F13, F13, _none_ )
  1368. #define T75 _NE(F14, F14, _none_ )
  1369. #define T76 _NE(F15, F15, F24 )
  1370. #define T77 _NE(F16, F16, _none_ )
  1371. #define T78 _NE(CLEAR, CLEAR, _none_ )
  1372. #define T79 _NE(HELP, HELP, CONVERT )
  1373. #define T7A _NE(END, END, _none_ )
  1374. #define T7B _NE(OEM_SCROLL,OEM_SCROLL,NONCONVERT)
  1375. #define T7C _NE(PAUSE, PAUSE, TAB )
  1376. #define T7D _NE(SNAPSHOT, SNAPSHOT, OEM_5 )
  1377. #define T7E _NE(_none_, _none_, ABNT_C2 )
  1378. #define T7F _NE(_none_, _none_, OEM_PA2 )
  1379. #define X1C _NE(_none_, _none_, RETURN )
  1380. #define X1D _NE(_none_, _none_, RCONTROL )
  1381. #define X33 _EQ( _none_ )
  1382. #define X35 _NE(_none_, _none_, DIVIDE )
  1383. #define X37 _NE(_none_, _none_, SNAPSHOT )
  1384. #define X38 _NE(_none_, _none_, RMENU )
  1385. #define X42 _EQ( _none_ )
  1386. #define X43 _EQ( _none_ )
  1387. #define X44 _EQ( _none_ )
  1388. #define X46 _NE(_none_, _none_, CANCEL )
  1389. #define X47 _NE(_none_, _none_, HOME )
  1390. #define X48 _NE(_none_, _none_, UP )
  1391. #define X49 _NE(_none_, _none_, PRIOR )
  1392. #define X4B _NE(_none_, _none_, LEFT )
  1393. #define X4D _NE(_none_, _none_, RIGHT )
  1394. #define X4F _NE(_none_, _none_, END )
  1395. #define X50 _NE(_none_, _none_, DOWN )
  1396. #define X51 _NE(_none_, _none_, NEXT )
  1397. #define X52 _NE(_none_, _none_, INSERT )
  1398. #define X53 _NE(_none_, _none_, DELETE )
  1399. #define X5B _NE(_none_, _none_, LWIN )
  1400. #define X5C _NE(_none_, _none_, RWIN )
  1401. #define X5D _NE(_none_, _none_, APPS )
  1402. #define X5E _EQ( POWER )
  1403. #define X5F _EQ( SLEEP )
  1404. #define X60 _NE(OEM_SCROLL,OEM_SCROLL,_none_ )
  1405. #define X61 _NE(HOME, HOME, _none_ )
  1406. #define X62 _NE(END, END, _none_ )
  1407. #define X63 _EQ( _none_ )
  1408. #define X64 _EQ( _none_ )
  1409. #define X65 _EQ( _none_ )
  1410. #define X66 _EQ( _none_ )
  1411. #define X6D _NE(OEM_TOUROKU,OEM_TOUROKU,_none_ )
  1412. #define X71 _NE(DBE_SBCSCHAR,DBE_SBCSCHAR,_none_)
  1413. #define X74 _EQ( _none_ )
  1414. #define X75 _EQ( _none_ )
  1415. #define X76 _EQ( _none_ )
  1416. #define X77 _EQ( _none_ )
  1417. #define X78 _EQ( _none_ )
  1418. #define X79 _EQ( _none_ )
  1419. #define X7A _EQ( _none_ )
  1420. #define X7B _EQ( _none_ )
  1421. /*
  1422. * The break key is sent to us as E1,LCtrl,NumLock
  1423. * We must convert the E1+LCtrl to BREAK, then ignore the Numlock
  1424. * which must be ignored. Alternatively, translate Ctrl-Numlock
  1425. * to break, but don't let the CTRL through as a WM_KEYUP/DOWN) ?
  1426. */
  1427. #define Y1D _EQ( PAUSE )
  1428. #elif (KBD_TYPE >= 30) && (KBD_TYPE <= 34)
  1429. /***********************************************************************\
  1430. * T** - Values for ausVK[] (Virtual Scan Code to Virtual Key conversion)
  1431. *
  1432. * Three sets of keyboards are supported, according to KBD_TYPE:
  1433. *
  1434. * KBD_TYPE Keyboard (examples)
  1435. * ======== =====================================
  1436. * 30 * NEC PC-9800 Normal Keyboard.
  1437. * 31 NEC PC-9800 Document processor Keyboard. - not supported on NT5
  1438. * 32 NEC PC-9800 106 Keyboard. - same as KBD_TYPE 8
  1439. * 33 NEC PC-9800 for Hydra: PC-9800 Keyboard on Windows NT 5.0.
  1440. * NEC PC-98NX for Hydra: PC-9800 Keyboard on Windows 95/NT.
  1441. * 34 NEC PC-9800 for Hydra: PC-9800 Keyboard on Windows NT 3.51/4.0.
  1442. *
  1443. * +------+ +----------+----------+----------+
  1444. * | Scan | | kbd | kbd | kbd |
  1445. * | code | | type 30 | type 33 | type 34 |
  1446. \****+-------+-+----------+----------+----------+***********************/
  1447. #define T00 _EQ(_none_ )
  1448. #define T01 _EQ(ESCAPE )
  1449. #define T02 _EQ('1' )
  1450. #define T03 _EQ('2' )
  1451. #define T04 _EQ('3' )
  1452. #define T05 _EQ('4' )
  1453. #define T06 _EQ('5' )
  1454. #define T07 _EQ('6' )
  1455. #define T08 _EQ('7' )
  1456. #define T09 _EQ('8' )
  1457. #define T0A _EQ('9' )
  1458. #define T0B _EQ('0' )
  1459. #define T0C _EQ(OEM_MINUS )
  1460. #define T0D _NE(OEM_7, OEM_7, OEM_PLUS )
  1461. #define T0E _EQ(BACK )
  1462. #define T0F _EQ(TAB )
  1463. #define T10 _EQ('Q' )
  1464. #define T11 _EQ('W' )
  1465. #define T12 _EQ('E' )
  1466. #define T13 _EQ('R' )
  1467. #define T14 _EQ('T' )
  1468. #define T15 _EQ('Y' )
  1469. #define T16 _EQ('U' )
  1470. #define T17 _EQ('I' )
  1471. #define T18 _EQ('O' )
  1472. #define T19 _EQ('P' )
  1473. #define T1A _NE(OEM_3, OEM_3, OEM_4 )
  1474. #define T1B _NE(OEM_4, OEM_4, OEM_6 )
  1475. #define T1C _EQ(RETURN )
  1476. #define T1D _EQ(LCONTROL )
  1477. #define T1E _EQ('A' )
  1478. #define T1F _EQ('S' )
  1479. #define T20 _EQ('D' )
  1480. #define T21 _EQ('F' )
  1481. #define T22 _EQ('G' )
  1482. #define T23 _EQ('H' )
  1483. #define T24 _EQ('J' )
  1484. #define T25 _EQ('K' )
  1485. #define T26 _EQ('L' )
  1486. #define T27 _NE(OEM_PLUS, OEM_PLUS, OEM_1 )
  1487. #define T28 _NE(OEM_1, OEM_1, OEM_7 )
  1488. #define T29 _NE(DBE_SBCSCHAR, \
  1489. DBE_SBCSCHAR, \
  1490. OEM_3 )
  1491. #define T2A _EQ(LSHIFT )
  1492. #define T2B _NE(OEM_6, OEM_6, OEM_5 )
  1493. #define T2C _EQ('Z' )
  1494. #define T2D _EQ('X' )
  1495. #define T2E _EQ('C' )
  1496. #define T2F _EQ('V' )
  1497. #define T30 _EQ('B' )
  1498. #define T31 _EQ('N' )
  1499. #define T32 _EQ('M' )
  1500. #define T33 _EQ(OEM_COMMA )
  1501. #define T34 _EQ(OEM_PERIOD )
  1502. #define T35 _EQ(OEM_2 )
  1503. #define T36 _EQ(RSHIFT )
  1504. #define T37 _EQ(MULTIPLY )
  1505. #define T38 _EQ(LMENU )
  1506. #define T39 _EQ(' ' )
  1507. #define T3A _EQ(CAPITAL )
  1508. #define T3B _EQ(F1 )
  1509. #define T3C _EQ(F2 )
  1510. #define T3D _EQ(F3 )
  1511. #define T3E _EQ(F4 )
  1512. #define T3F _EQ(F5 )
  1513. #define T40 _EQ(F6 )
  1514. #define T41 _EQ(F7 )
  1515. #define T42 _EQ(F8 )
  1516. #define T43 _EQ(F9 )
  1517. #define T44 _EQ(F10 )
  1518. #define T45 _EQ(NUMLOCK )
  1519. #define T46 _EQ(OEM_SCROLL )
  1520. #define T47 _NE(NUMPAD7, NUMPAD7, HOME )
  1521. #define T48 _NE(NUMPAD8, NUMPAD8, UP )
  1522. #define T49 _NE(NUMPAD9, NUMPAD9, PRIOR )
  1523. #define T4A _EQ(SUBTRACT )
  1524. #define T4B _NE(NUMPAD4, NUMPAD4, LEFT )
  1525. #define T4C _NE(NUMPAD5, NUMPAD5, CLEAR )
  1526. #define T4D _NE(NUMPAD6, NUMPAD6, RIGHT )
  1527. #define T4E _EQ(ADD )
  1528. #define T4F _NE(NUMPAD1, NUMPAD1, END )
  1529. #define T50 _NE(NUMPAD2, NUMPAD2, DOWN )
  1530. #define T51 _NE(NUMPAD3, NUMPAD3, NEXT )
  1531. #define T52 _NE(NUMPAD0, NUMPAD0, INSERT )
  1532. #define T53 _NE(DECIMAL, DECIMAL, DELETE )
  1533. #define T54 _EQ(SNAPSHOT )
  1534. #define T55 _NE(_none_, _none_, OEM_8 )
  1535. #define T56 _EQ(_none_ )
  1536. #define T57 _EQ(F11 )
  1537. #define T58 _EQ(F12 )
  1538. #define T59 _EQ(OEM_NEC_EQUAL )
  1539. #define T5A _NE(NONAME, NONAME, NONCONVERT)
  1540. #define T5B _NE(_none_, _none_, NONAME )
  1541. #define T5C _EQ(OEM_NEC_SEPARATE )
  1542. #define T5D _EQ(F13 )
  1543. #define T5E _EQ(F14 )
  1544. #define T5F _EQ(F15 )
  1545. #define T60 _EQ(_none_ )
  1546. #define T61 _EQ(_none_ )
  1547. #define T62 _EQ(_none_ )
  1548. #define T63 _EQ(_none_ )
  1549. #define T64 _NE(_none_, _none_, F13 )
  1550. #define T65 _NE(_none_, _none_, F14 )
  1551. #define T66 _NE(_none_, _none_, F15 )
  1552. #define T67 _NE(_none_, _none_, F16 )
  1553. #define T68 _NE(_none_, _none_, F17 )
  1554. #define T69 _NE(_none_, _none_, F18 )
  1555. #define T6A _NE(_none_, _none_, F19 )
  1556. #define T6B _NE(_none_, _none_, F20 )
  1557. #define T6C _NE(_none_, _none_, F21 )
  1558. #define T6D _NE(_none_, _none_, F22 )
  1559. #define T6E _NE(_none_, _none_, F23 )
  1560. #define T6F _EQ(_none_ )
  1561. #define T70 _NE(KANA, KANA, DBE_HIRAGANA)
  1562. #define T71 _EQ(_none_ )
  1563. #define T72 _EQ(_none_ )
  1564. #define T73 _NE(OEM_8, OEM_8, _none_ )
  1565. #define T74 _NE(_none_, OEM_NEC_EQUAL, \
  1566. _none_ )
  1567. #define T75 _NE(_none_, OEM_NEC_SEPARATE, \
  1568. _none_ )
  1569. #define T76 _NE(_none_, _none_, F24 )
  1570. #define T77 _NE(_none_, _none_, DBE_SBCSCHAR)
  1571. #define T78 _EQ(_none_ )
  1572. #define T79 _EQ(CONVERT )
  1573. #define T7A _EQ(_none_ )
  1574. #define T7B _EQ(NONCONVERT )
  1575. #define T7C _NE(TAB, _none_, _none_ )
  1576. #define T7D _NE(OEM_5, OEM_5, _none_ )
  1577. #define T7E _NE(ABNT_C2, ABNT_C2, _none_ )
  1578. #define T7F _NE(OEM_PA2, OEM_PA2, _none_ )
  1579. #define X1C _EQ(RETURN )
  1580. #define X1D _NE(RCONTROL, RCONTROL, KANA )
  1581. #define X33 _EQ(_none_ )
  1582. #define X35 _EQ(DIVIDE )
  1583. #define X37 _EQ(SNAPSHOT )
  1584. #define X38 _NE(_none_, _none_, KANJI )
  1585. #define X42 _NE(_none_, _none_, RCONTROL )
  1586. #define X43 _NE(_none_, _none_, RMENU )
  1587. #define X44 _EQ(_none_ )
  1588. #define X46 _EQ(CANCEL )
  1589. #define X47 _EQ(HOME )
  1590. #define X48 _EQ(UP )
  1591. #define X49 _EQ(PRIOR )
  1592. #define X4B _EQ(LEFT )
  1593. #define X4D _EQ(RIGHT )
  1594. #define X4F _EQ(END )
  1595. #define X50 _EQ(DOWN )
  1596. #define X51 _EQ(NEXT )
  1597. #define X52 _EQ(INSERT )
  1598. #define X53 _EQ(DELETE )
  1599. #define X5B _EQ(LWIN )
  1600. #define X5C _EQ(RWIN )
  1601. #define X5D _EQ(APPS )
  1602. #define X5E _EQ(POWER )
  1603. #define X5F _EQ(SLEEP )
  1604. #define X60 _EQ(_none_ )
  1605. #define X61 _EQ(_none_ )
  1606. #define X62 _EQ(_none_ )
  1607. #define X63 _EQ(_none_ )
  1608. #define X64 _EQ(_none_ )
  1609. #define X65 _EQ(_none_ )
  1610. #define X66 _EQ(_none_ )
  1611. #define X6D _EQ(_none_ )
  1612. #define X71 _EQ(_none_ )
  1613. #define X74 _EQ(_none_ )
  1614. #define X75 _EQ(_none_ )
  1615. #define X76 _EQ(_none_ )
  1616. #define X77 _EQ(_none_ )
  1617. #define X78 _EQ(_none_ )
  1618. #define X79 _EQ(_none_ )
  1619. #define X7A _EQ(_none_ )
  1620. #define X7B _EQ(_none_ )
  1621. /*
  1622. * The break key is sent to us as E1,LCtrl,NumLock
  1623. * We must convert the E1+LCtrl to BREAK, then ignore the Numlock
  1624. * which must be ignored. Alternatively, translate Ctrl-Numlock
  1625. * to break, but don't let the CTRL through as a WM_KEYUP/DOWN) ?
  1626. */
  1627. #define Y1D _EQ(PAUSE )
  1628. #elif (KBD_TYPE == 37)
  1629. /***********************************************************************\
  1630. * T** - Values for ausVK[] (Virtual Scan Code to Virtual Key conversion)
  1631. *
  1632. * Three sets of keyboards are supported, according to KBD_TYPE:
  1633. *
  1634. * KBD_TYPE Keyboard (examples)
  1635. * ======== =====================================
  1636. * 37 * NEC PC-9800 for Hydra: PC-9800 Keyboard on Windows 95.
  1637. *
  1638. * +------+ +----------+
  1639. * | Scan | | kbd |
  1640. * | code | | type 37 |
  1641. \****+-------+-+----------+*********************************************/
  1642. #define T00 _EQ(ESCAPE )
  1643. #define T01 _EQ('1' )
  1644. #define T02 _EQ('2' )
  1645. #define T03 _EQ('3' )
  1646. #define T04 _EQ('4' )
  1647. #define T05 _EQ('5' )
  1648. #define T06 _EQ('6' )
  1649. #define T07 _EQ('7' )
  1650. #define T08 _EQ('8' )
  1651. #define T09 _EQ('9' )
  1652. #define T0A _EQ('0' )
  1653. #define T0B _EQ(OEM_MINUS )
  1654. #define T0C _EQ(OEM_7 )
  1655. #define T0D _EQ(OEM_5 )
  1656. #define T0E _EQ(BACK )
  1657. #define T0F _EQ(TAB )
  1658. #define T10 _EQ('Q' )
  1659. #define T11 _EQ('W' )
  1660. #define T12 _EQ('E' )
  1661. #define T13 _EQ('R' )
  1662. #define T14 _EQ('T' )
  1663. #define T15 _EQ('Y' )
  1664. #define T16 _EQ('U' )
  1665. #define T17 _EQ('I' )
  1666. #define T18 _EQ('O' )
  1667. #define T19 _EQ('P' )
  1668. #define T1A _EQ(OEM_3 )
  1669. #define T1B _EQ(OEM_4 )
  1670. #define T1C _EQ(RETURN )
  1671. #define T1D _EQ('A' )
  1672. #define T1E _EQ('S' )
  1673. #define T1F _EQ('D' )
  1674. #define T20 _EQ('F' )
  1675. #define T21 _EQ('G' )
  1676. #define T22 _EQ('H' )
  1677. #define T23 _EQ('J' )
  1678. #define T24 _EQ('K' )
  1679. #define T25 _EQ('L' )
  1680. #define T26 _EQ(OEM_PLUS )
  1681. #define T27 _EQ(OEM_1 )
  1682. #define T28 _EQ(OEM_6 )
  1683. #define T29 _EQ('Z' )
  1684. #define T2A _EQ('X' )
  1685. #define T2B _EQ('C' )
  1686. #define T2C _EQ('V' )
  1687. #define T2D _EQ('B' )
  1688. #define T2E _EQ('N' )
  1689. #define T2F _EQ('M' )
  1690. #define T30 _EQ(OEM_COMMA )
  1691. #define T31 _EQ(OEM_PERIOD)
  1692. #define T32 _EQ(OEM_2 )
  1693. #define T33 _EQ(OEM_8 )
  1694. #define T34 _EQ(' ' )
  1695. #define T35 _EQ(CONVERT )
  1696. #define T36 _EQ(NEXT )
  1697. #define T37 _EQ(PRIOR )
  1698. #define T38 _EQ(INSERT )
  1699. #define T39 _EQ(DELETE )
  1700. #define T3A _EQ(UP )
  1701. #define T3B _EQ(LEFT )
  1702. #define T3C _EQ(RIGHT )
  1703. #define T3D _EQ(DOWN )
  1704. #define T3E _EQ(HOME )
  1705. #define T3F _EQ(END )
  1706. #define T40 _EQ(SUBTRACT )
  1707. #define T41 _EQ(DIVIDE )
  1708. #define T42 _EQ(NUMPAD7 )
  1709. #define T43 _EQ(NUMPAD8 )
  1710. #define T44 _EQ(NUMPAD9 )
  1711. #define T45 _EQ(MULTIPLY )
  1712. #define T46 _EQ(NUMPAD4 )
  1713. #define T47 _EQ(NUMPAD5 )
  1714. #define T48 _EQ(NUMPAD6 )
  1715. #define T49 _EQ(ADD )
  1716. #define T4A _EQ(NUMPAD1 )
  1717. #define T4B _EQ(NUMPAD2 )
  1718. #define T4C _EQ(NUMPAD3 )
  1719. #define T4D _EQ(OEM_NEC_EQUAL)
  1720. #define T4E _EQ(NUMPAD0 )
  1721. #define T4F _EQ(OEM_NEC_SEPARATE)
  1722. #define T50 _EQ(DECIMAL )
  1723. #define T51 _EQ(NONCONVERT)
  1724. #define T52 _EQ(F11 )
  1725. #define T53 _EQ(F12 )
  1726. #define T54 _EQ(F13 )
  1727. #define T55 _EQ(F14 )
  1728. #define T56 _EQ(F15 )
  1729. #define T57 _EQ(_none_ )
  1730. #define T58 _EQ(_none_ )
  1731. #define T59 _EQ(_none_ )
  1732. #define T5A _EQ(_none_ )
  1733. #define T5B _EQ(_none_ )
  1734. #define T5C _EQ(RETURN )
  1735. #define T5D _EQ(_none_ )
  1736. #define T5E _EQ(_none_ )
  1737. #define T5F _EQ(_none_ )
  1738. #define T60 _EQ(CANCEL )
  1739. #define T61 _EQ(SNAPSHOT )
  1740. #define T62 _EQ(F1 )
  1741. #define T63 _EQ(F2 )
  1742. #define T64 _EQ(F3 )
  1743. #define T65 _EQ(F4 )
  1744. #define T66 _EQ(F5 )
  1745. #define T67 _EQ(F6 )
  1746. #define T68 _EQ(F7 )
  1747. #define T69 _EQ(F8 )
  1748. #define T6A _EQ(F9 )
  1749. #define T6B _EQ(F10 )
  1750. #define T6C _EQ(_none_ )
  1751. #define T6D _EQ(_none_ )
  1752. #define T6E _EQ(_none_ )
  1753. #define T6F _EQ(_none_ )
  1754. #define T70 _EQ(LSHIFT )
  1755. #define T71 _EQ(CAPITAL )
  1756. #define T72 _EQ(KANA )
  1757. #define T73 _EQ(LMENU )
  1758. #define T74 _EQ(LCONTROL )
  1759. #define T75 _EQ(_none_ )
  1760. #define T76 _EQ(_none_ )
  1761. #define T77 _EQ(LWIN )
  1762. #define T78 _EQ(RWIN )
  1763. #define T79 _EQ(APPS )
  1764. #define T7A _EQ(_none_ )
  1765. #define T7B _EQ(_none_ )
  1766. #define T7C _EQ(_none_ )
  1767. #define T7D _EQ(RSHIFT )
  1768. #define T7E _EQ(ABNT_C2 )
  1769. #define T7F _EQ(OEM_PA2 )
  1770. /*
  1771. * The break key is sent to us as E1,LCtrl,NumLock
  1772. * We must conevrt the E1+LCtrl to BREAK, then ignore the Numlock
  1773. * which must be ignored. Alternatively, translate Ctrl-Numlock
  1774. * to break, but don't let the CTRL through as a WM_KEYUP/DOWN) ?
  1775. */
  1776. #define Y1D _EQ(PAUSE )
  1777. #elif (KBD_TYPE >= 40) && (KBD_TYPE <= 41)
  1778. /***********************************************************************\
  1779. * T** - Values for ausVK[] (Virtual Scan Code to Virtual Key conversion)
  1780. *
  1781. * Two sets of keyboards are supported, according to KBD_TYPE:
  1782. *
  1783. * KBD_TYPE Keyboard (examples)
  1784. * ======== =====================================
  1785. * 40 * DEC LK411-JJ (JIS layout) keyboard
  1786. * 41 DEC LK411-AJ (ANSI layout) keyboard
  1787. *
  1788. * +------+ +-----------+-----------+
  1789. * | Scan | | kbd | kbd |
  1790. * | code | | LK411-JJ | LK411-AJ |
  1791. \*****+------+-+-----------+-----------+********************************/
  1792. #define T00 _EQ( _none_ )
  1793. #define T01 _EQ( ESCAPE )
  1794. #define T02 _EQ( '1' )
  1795. #define T03 _EQ( '2' )
  1796. #define T04 _EQ( '3' )
  1797. #define T05 _EQ( '4' )
  1798. #define T06 _EQ( '5' )
  1799. #define T07 _EQ( '6' )
  1800. #define T08 _EQ( '7' )
  1801. #define T09 _EQ( '8' )
  1802. #define T0A _EQ( '9' )
  1803. #define T0B _EQ( '0' )
  1804. #define T0C _EQ( OEM_MINUS )
  1805. #define T0D _NE( OEM_7, OEM_PLUS ) // "^"/"="
  1806. #define T0E _EQ( BACK )
  1807. #define T0F _EQ( TAB )
  1808. #define T10 _EQ( 'Q' )
  1809. #define T11 _EQ( 'W' )
  1810. #define T12 _EQ( 'E' )
  1811. #define T13 _EQ( 'R' )
  1812. #define T14 _EQ( 'T' )
  1813. #define T15 _EQ( 'Y' )
  1814. #define T16 _EQ( 'U' )
  1815. #define T17 _EQ( 'I' )
  1816. #define T18 _EQ( 'O' )
  1817. #define T19 _EQ( 'P' )
  1818. #define T1A _NE( OEM_3, OEM_4 ) // "@"/"["
  1819. #define T1B _NE( OEM_4, OEM_6 ) // "["/"]"
  1820. #define T1C _EQ( RETURN )
  1821. #define T1D _EQ( LCONTROL )
  1822. #define T1E _EQ( 'A' )
  1823. #define T1F _EQ( 'S' )
  1824. #define T20 _EQ( 'D' )
  1825. #define T21 _EQ( 'F' )
  1826. #define T22 _EQ( 'G' )
  1827. #define T23 _EQ( 'H' )
  1828. #define T24 _EQ( 'J' )
  1829. #define T25 _EQ( 'K' )
  1830. #define T26 _EQ( 'L' )
  1831. #define T27 _NE( OEM_PLUS, OEM_1 ) // ";"
  1832. #define T28 _NE( OEM_1, OEM_7 ) // ":"/"'"
  1833. #define T29 _NE( _none_, DBE_SBCSCHAR ) // LK411AJ uses "<>" as SBCS/DBCS key
  1834. #define T2A _EQ( LSHIFT )
  1835. #define T2B _NE( OEM_6, OEM_5 ) // "]"/"\"
  1836. #define T2C _EQ( 'Z' )
  1837. #define T2D _EQ( 'X' )
  1838. #define T2E _EQ( 'C' )
  1839. #define T2F _EQ( 'V' )
  1840. #define T30 _EQ( 'B' )
  1841. #define T31 _EQ( 'N' )
  1842. #define T32 _EQ( 'M' )
  1843. #define T33 _EQ( OEM_COMMA )
  1844. #define T34 _EQ( OEM_PERIOD )
  1845. #define T35 _EQ( OEM_2 ) // "/"
  1846. #define T36 _EQ( RSHIFT )
  1847. #define T37 _EQ( MULTIPLY ) // PF3 : "*"
  1848. #define T38 _EQ( LMENU ) // Alt(Left)
  1849. #define T39 _EQ( ' ' ) // Space
  1850. #define T3A _EQ( CAPITAL ) // LOCK : Caps Lock
  1851. #define T3B _EQ( F1 )
  1852. #define T3C _EQ( F2 )
  1853. #define T3D _EQ( F3 )
  1854. #define T3E _EQ( F4 )
  1855. #define T3F _EQ( F5 )
  1856. #define T40 _EQ( F6 )
  1857. #define T41 _EQ( F7 )
  1858. #define T42 _EQ( F8 )
  1859. #define T43 _EQ( F9 )
  1860. #define T44 _EQ( F10 )
  1861. #define T45 _EQ( NUMLOCK ) // PF1 : Num Lock
  1862. #define T46 _EQ( OEM_SCROLL ) // F19 : Scroll Lock
  1863. #define T47 _EQ( HOME ) // KP7 : Home
  1864. #define T48 _EQ( UP ) // KP8 : Up
  1865. #define T49 _EQ( PRIOR ) // KP9 : Page Up
  1866. #define T4A _EQ( SUBTRACT ) // PF4 : "-"
  1867. #define T4B _EQ( LEFT ) // KP4 : Left
  1868. #define T4C _EQ( CLEAR ) // KP5 : Clear
  1869. #define T4D _EQ( RIGHT ) // KP6 : Right
  1870. #define T4E _EQ( ADD ) // KP, : Add
  1871. #define T4F _EQ( END ) // KP1 : End
  1872. #define T50 _EQ( DOWN ) // KP2 : Down
  1873. #define T51 _EQ( NEXT ) // KP3 : Next
  1874. #define T52 _EQ( INSERT ) // KP0 : Ins
  1875. #define T53 _EQ( DELETE ) // KP. : Del
  1876. #define T54 _EQ( SNAPSHOT )
  1877. #define T55 _EQ( _none_ )
  1878. #define T56 _EQ( _none_ )
  1879. #define T57 _EQ( F11 )
  1880. #define T58 _EQ( F12 )
  1881. #define T59 _EQ( _none_ )
  1882. #define T5A _EQ( _none_ )
  1883. #define T5B _EQ( _none_ )
  1884. #define T5C _EQ( _none_ )
  1885. #define T5D _EQ( _none_ )
  1886. #define T5E _EQ( _none_ )
  1887. #define T5F _EQ( _none_ )
  1888. #define T60 _EQ( _none_ )
  1889. #define T61 _EQ( _none_ )
  1890. #define T62 _EQ( _none_ )
  1891. #define T63 _EQ( _none_ )
  1892. #define T64 _EQ( _none_ )
  1893. #define T65 _EQ( _none_ )
  1894. #define T66 _EQ( _none_ )
  1895. #define T67 _EQ( _none_ )
  1896. #define T68 _EQ( _none_ )
  1897. #define T69 _EQ( _none_ )
  1898. #define T6A _EQ( _none_ )
  1899. #define T6B _EQ( _none_ )
  1900. #define T6C _EQ( _none_ )
  1901. #define T6D _EQ( _none_ )
  1902. #define T6E _EQ( _none_ )
  1903. #define T6F _EQ( _none_ )
  1904. #define T70 _EQ( DBE_HIRAGANA ) // Hiragana/Katakana
  1905. #define T71 _EQ( _none_ )
  1906. #define T72 _EQ( _none_ )
  1907. #define T73 _NE( OEM_102, _none_ ) // LK411JJ, Katakana "Ro"
  1908. #define T74 _EQ( _none_ )
  1909. #define T75 _EQ( _none_ )
  1910. #define T76 _EQ( _none_ )
  1911. #define T77 _EQ( _none_ )
  1912. #define T78 _EQ( _none_ )
  1913. #define T79 _EQ( CONVERT ) // Henkan
  1914. #define T7A _EQ( _none_ )
  1915. #define T7B _EQ( NONCONVERT ) // Mu-Henkan
  1916. #define T7C _EQ( _none_ )
  1917. #define T7D _NE( OEM_5, _none_ ) // LK411JJ, Yen(Back-slash)
  1918. #define T7E _EQ( _none_ )
  1919. #define T7F _EQ( _none_ )
  1920. #define X0F _EQ( KANA ) // Kana
  1921. #define X1C _EQ( RETURN ) // Enter
  1922. #define X1D _EQ( RCONTROL ) // Comp : Right Control
  1923. #define X33 _EQ( _none_ )
  1924. #define X35 _EQ( DIVIDE ) // PF2: "/"
  1925. #define X37 _EQ( SNAPSHOT ) // F18: PrintScreen
  1926. #define X38 _EQ( RMENU ) // Alt(Right)
  1927. #define X3D _EQ( F13 )
  1928. #define X3E _EQ( F14 )
  1929. #define X3F _EQ( F15 ) // Help : F15
  1930. #define X40 _EQ( F16 ) // Do : F16
  1931. #define X41 _EQ( F17 )
  1932. #define X42 _EQ( _none_ )
  1933. #define X43 _EQ( _none_ )
  1934. #define X44 _EQ( _none_ )
  1935. #define X46 _EQ( CANCEL )
  1936. #define X47 _EQ( HOME ) // Find : HOME
  1937. #define X48 _EQ( UP )
  1938. #define X49 _EQ( PRIOR ) // Prev : PageUp
  1939. #define X4B _EQ( LEFT )
  1940. #define X4D _EQ( RIGHT )
  1941. #define X4E _EQ( ADD ) // KP- (Minus but "Add")
  1942. #define X4F _EQ( END ) // Select : END
  1943. #define X50 _EQ( DOWN )
  1944. #define X51 _EQ( NEXT ) // Next : PageDown
  1945. #define X52 _EQ( INSERT )
  1946. #define X53 _EQ( DELETE ) // Remove
  1947. #define X5B _EQ( _none_ )
  1948. #define X5C _EQ( _none_ )
  1949. #define X5D _EQ( _none_ )
  1950. #define X5E _EQ( POWER )
  1951. #define X5F _EQ( SLEEP )
  1952. /*
  1953. * The break key is sent to us as E1,LCtrl,NumLock
  1954. * We must convert the E1+LCtrl to BREAK, then ignore the Numlock
  1955. */
  1956. #define Y1D _EQ( PAUSE )
  1957. #endif // KBD_TYPE
  1958. #define SCANCODE_LSHIFT 0x2A
  1959. #define SCANCODE_RSHIFT 0x36
  1960. #define SCANCODE_CTRL 0x1D
  1961. #define SCANCODE_ALT 0x38
  1962. #define SCANCODE_SIMULATED (FAKE_KEYSTROKE >> 16)
  1963. #define SCANCODE_NUMPAD_FIRST 0x47
  1964. #define SCANCODE_NUMPAD_LAST 0x52
  1965. #define SCANCODE_LWIN 0x5B
  1966. #define SCANCODE_RWIN 0x5C
  1967. #define SCANCODE_THAI_LAYOUT_TOGGLE 0x29
  1968. /*
  1969. * Hydra FarEast
  1970. */
  1971. /*
  1972. * Structure for client keyboard information
  1973. */
  1974. typedef struct _CLIENTKEYBOARDTYPE {
  1975. ULONG Type;
  1976. ULONG SubType;
  1977. ULONG FunctionKey;
  1978. } CLIENTKEYBOARDTYPE, *PCLIENTKEYBOARDTYPE;
  1979. #endif // _KBD_