//Windows2000源代码中
//Public部分kbd.h文件,我猜可能是键盘指令,只是猜测
[复制PHP代码]PHP代码如下:
/****************************** Module Header ******************************\
* Module Name: kbd.h
*
* Copyright (c) 1985-91, Microsoft Corporation
*
* Keyboard table values that [form] the basis for languages and keyboard types.
* The basis is US, kbd type 4 - all others are a variation on this.
* This file is included by all kbd**.h files.
*
* History:
* 10-Jan-1991 GregoryW
* 23-Apr-1991 IanJa VSC_TO_VK _* macros from oemtab.c
\***************************************************************************/
#ifndef _KBD_
#define _KBD_
/****************************************************************************\
*
* Keyboard Layers. Used in kdb??.dll and in usersrv.dll
*
\****************************************************************************/
/*
* Key Event (KE) structure
* Stores a Virtual Key event
*/
typedef struct tagKE {
union {
BYTE bScanCode; // Virtual Scan Code (Set 1)
WCHAR wchInjected; // Unicode char from SendInput()
};
USHORT usFlaggedVk; // Vk | Flags
DWORD dwTime; // time in milliseconds
} KE, *PKE;
typedef BOOL (* KEPROC)(PKE pKe);
/*
* KE.usFlaggedVk values, also used in the keyboard layer tables.
*/
#define KBDEXT (USHORT)0x0100
#define KBDMULTIVK (USHORT)0x0200
#define KBDSPECIAL (USHORT)0x0400
#define KBDNUMPAD (USHORT)0x0800
#define KBDUNICODE (USHORT)0x1000
#define KBDINJECTEDVK (USHORT)0x2000
#define KBDBREAK (USHORT)0x8000
/*
* Key message lParam bits
*/
#define EXTENDED_BIT 0x01000000
#define DONTCARE_BIT 0x02000000
#define FAKE_KEYSTROKE 0x02000000
#define ALTNUMPAD_BIT 0x04000000 // copied from windows\inc\wincon.w
/*
* Keyboard Shift State defines. These correspond to the bit mask defined
* by the VkKeyScan() API.
*/
#define KBDBASE 0
#define KBDSHIFT 1
#define KBDCTRL 2
#define KBDALT 4
// three symbols KANA, ROYA, LOYA are for FE
#define KBDKANA 8
#define KBDROYA 0x10
#define KBDLOYA 0x20
#define KBDGRPSELTAP 0x80
/*
* Handy diacritics
*/
#define GRAVE 0x0300
#define ACUTE 0x0301
#define CIRCUMFLEX 0x0302
#define TILDE 0x0303
#define MACRON 0x0304
#define OVERSCORE 0x0305
#define BREVE 0x0306
#define DOT_ABOVE 0x0307
#define UMLAUT 0x0308
#define DIARESIS UMLAUT
#define HOOK_ABOVE 0x0309
#define RING 0x030A
#define DOUBLE_ACUTE 0x030B
#define HACEK 0x030C
#define CEDILLA 0x0327
#define OGONEK 0x0328
#define TONOS 0x0384
#define DIARESIS_TONOS 0x0385
#define wszGRAVE L"\x0300"
#define wszACUTE L"\x0301"
#define wszCIRCUMFLEX L"\x0302"
#define wszTILDE L"\x0303"
#define wszMACRON L"\x0304"
#define wszOVERSCORE L"\x0305"
#define wszBREVE L"\x0306"
#define wszDOT_ABOVE L"\x0307"
#define wszUMLAUT L"\x0308"
#define wszHOOK_ABOVE L"\x0309"
#define wszRING L"\x030A"
#define wszDOUBLE_ACUTE L"\x030B"
#define wszHACEK L"\x030C"
#define wszCEDILLA L"\x0327"
#define wszOGONEK L"\x0328"
#define wszTONOS L"\x0384"
#define wszDIARESIS_TONOS L"\x0385"
#define IDS_FROM_SCANCODE(prefix, base) \
(0xc000 + ((0x ## prefix) >= 0xE0 ? 0x100 : 0) + (0x ## base))
/***************************************************************************\
* MODIFIER KEYS
*
* All keyboards have "Modifier" keys which are used to alter the behaviour of
* some of the other keys. These shifter keys are usually:
* Shift (left and/or right Shift key)
* Ctrl (left and/or right Ctrl key)
* Alt (left and/or right Alt key)
* AltGr (right Alt key only)
*
* NOTE:
* All keyboards use the Shift key.
* All keyboards use a Ctrl key to generate ASCII control characters.
* All keyboards with a number pad use the Alt key and the NumPad to
* generate characters by number.
* Keyboards using AltGr as a Modifier Key usually translate the Virtual
* ScanCode to Virtual Keys VK_CTRL + VK_ALT at input time: the Modifier
* tables should be written to treat Ctrl + Alt as a valid shifter
* key combination in these cases.
*
* By holding down 0 or more of these Modifier keys, a "shift state" is
* obtained : the shift state may affect the translation of Virtual Scancodes
* to Virtual Keys and/or the translation of Virtuals Key to Characters.
*
* EXAMPLES:
*
* Each key on a particular keyboard may be marked with up to five different
* characters in five different positions:
*
* .-------.
* /| |\
* : | 2 4 | :
* | | | |
* | | | |
* | | 1 3 | |
* | |_______| |
* | / \ |
* |/ 5 \|
* `-----------';
*
* A key may also be able to generate a character that is not marked on it:
* these are ASCII Control chars, lower-case letters and/or "invisible keys".
* .-------.
* An example of an "Invisible Key": /| |\
* : | > | :
* The German M24 keyboard 2 should produce the | | | |
* ';|'; character when ALT SHIFT is is held down | | | |
* while the '; Mod bits
WORD wMaxModBits; // max Modification bit combination value
BYTE ModNumber[]; // Mod bits -> Modification Number
} MODIFIERS, *PMODIFIERS;
WORD GetModifierBits(PMODIFIERS pModifiers, LPBYTE afKeyState);
WORD GetModificationNumber(PMODIFIERS pModifiers, WORD wModBits);
// FE Modifiers_VK
extern PMODIFIERS gpModifiers_VK;
extern MODIFIERS Modifiers_VK_STANDARD;
extern MODIFIERS Modifiers_VK_IBM02;
#define SHFT_INVALID 0x0F
/***************************************************************************\
* apulCvt_VK[] - obtain VK translation table from shift state
* A VK translation table is used to change the value of the Virtual Key
* according to the shift state. OEM only (not locale-specific)
\***************************************************************************/
extern PULONG *gapulCvt_VK;
extern ULONG *gapulCvt_VK_101[];
extern ULONG *gapulCvt_VK_84[];
// gapulCvt_VK_IBM02[] is for FE
extern ULONG *gapulCvt_VK_IBM02[];
/***************************************************************************\
* awNumPadCvt[] - Translate cursor movement keys to numpad keys
\***************************************************************************/
extern MODIFIERS Modifiers_VK;
extern BYTE aVkNumpad[];
/***************************************************************************\
* VSC_VK - Associate a Virtual Scancode with a Virtual Key
* Vsc - Virtual Scancode
* Vk - Virtual Key | flags
* Used by VKFromVSC() for scancodes prefixed 0xE0 or 0xE1
\***************************************************************************/
typedef struct _VSC_VK {
BYTE Vsc;
USHORT Vk;
} VSC_VK, *PVSC_VK;
/***************************************************************************\
* VK_VSC - Associate a Virtual Key with a Virtual Scancode
* Vk - Virtual Key
* Vsc - Virtual Scancode
* Used by MapVirtualKey for Virtual Keys not appearing in ausVK[]
\***************************************************************************/
typedef struct _VK_VSC {
BYTE Vk;
BYTE Vsc;
} VK_VSC, *PVK_VSC;
/***************************************************************************\
*
* VK_TO_WCHARS - Associate a Virtual Key with UNICODE characters
*
* VirtualKey - The Virtual Key.
* wch[] - An array of characters, one for each shift state that
* applies to the specified Virtual Key.
*
* Special values for VirtualKey:
* -1 - This entry contains dead chars for the previous entry
* 0 - Terminates a VK_TO_WCHARS[] table
*
* Special values for Attributes:
* CAPLOK - The CAPS-LOCK key affects this key like SHIFT
* SGCAPS - CapsLock uppercases the unshifted char (Swiss-German)
*
* Special values for wch:
* WCH_NONE - No character is generated by pressing this key with the
* current shift state.
* WCH_DEAD - The character is a dead-key: the next VK_TO_WCHARS[] entry
* will contain the values of the dead characters (diaresis)
* that can be produced by the Virtual Key.
* WCH_LGTR - The character is a ligature. The characters generated by
* this keystroke are found in the ligature table.
*
\***************************************************************************/
#define WCH_NONE 0xF000
#define WCH_DEAD 0xF001
#define WCH_LGTR 0xF002
#define CAPLOK 0x01
#define SGCAPS 0x02
#define CAPLOKALTGR 0x04
// KANALOK is for FE
#define KANALOK 0x08
#define GRPSELTAP 0x80
/*
* Macro for VK to WCHAR with "n" shift states
*/
#define TYPEDEF_VK_TO_WCHARS(n) typedef struct _VK_TO_WCHARS##n { \
BYTE VirtualKey;
BYTE Attributes;
WCHAR wch[n];
} VK_TO_WCHARS##n, *PVK_TO_WCHARS##n;
/*
* To facilitate coding the table scanning routine.
*/
/*
* Table element types (for various numbers of shift states), used
* to facilitate static initializations of tables.
* VK_TO_WCHARS1 and PVK_TO_WCHARS1 may be used as the generic type
*/
TYPEDEF_VK_TO_WCHARS(1) // VK_TO_WCHARS1, *PVK_TO_WCHARS1;
TYPEDEF_VK_TO_WCHARS(2) // VK_TO_WCHARS2, *PVK_TO_WCHARS2;
TYPEDEF_VK_TO_WCHARS(3) // VK_TO_WCHARS3, *PVK_TO_WCHARS3;
TYPEDEF_VK_TO_WCHARS(4) // VK_TO_WCHARS4, *PVK_TO_WCHARS4;
TYPEDEF_VK_TO_WCHARS(5) // VK_TO_WCHARS5, *PVK_TO_WCHARS5;
TYPEDEF_VK_TO_WCHARS(6) // VK_TO_WCHARS6, *PVK_TO_WCHARS5;
TYPEDEF_VK_TO_WCHARS(7) // VK_TO_WCHARS7, *PVK_TO_WCHARS7;
// these three (8,9,10) are for FE
TYPEDEF_VK_TO_WCHARS(8) // VK_TO_WCHARS8, *PVK_TO_WCHARS8;
TYPEDEF_VK_TO_WCHARS(9) // VK_TO_WCHARS9, *PVK_TO_WCHARS9;
TYPEDEF_VK_TO_WCHARS(10) // VK_TO_WCHARS10, *PVK_TO_WCHARS10;
/***************************************************************************\
*
* VK_TO_WCHAR_TABLE - Describe a table of VK_TO_WCHARS1
*
* pVkToWchars - points to the table.
* nModifications - the number of shift-states supported by this table.
* (this is the number of elements in pVkToWchars.wch[])
*
* A keyboard may have several such tables: all keys with the same number of
* shift-states are grouped together in one table.
*
* Special values for pVktoWchars:
* NULL - Terminates a VK_TO_WCHAR_TABLE[] list.
*
\***************************************************************************/
typedef struct _VK_TO_WCHAR_TABLE {
PVK_TO_WCHARS1 pVkToWchars;
BYTE nModifications;
BYTE cbSize;
} VK_TO_WCHAR_TABLE, *PVK_TO_WCHAR_TABLE;
/***************************************************************************\
*
* Dead Key (diaresis) tables
*
* LATER IanJa: supplant by an NLS API that composes Diacritic+Base -> WCHAR
*
\***************************************************************************/
typedef struct {
DWORD dwBoth; // diacritic & char
WCHAR wchComposed;
USHORT uFlags;
} DEADKEY, *PDEADKEY;
#define DEADTRANS(ch, accent, comp, flags) { MAKELONG(ch, accent), comp, flags}
/*
* Bit values for uFlags
*/
#define DKF_DEAD 0x0001
/***************************************************************************\
*
* Ligature table
*
\***************************************************************************/
/*
* Macro for ligature with "n" characters
*/
#define TYPEDEF_LIGATURE(n) typedef struct _LIGATURE##n { \
BYTE VirtualKey;
WORD ModificationNumber;
WCHAR wch[n];
} LIGATURE##n, *PLIGATURE##n;
/*
* To facilitate coding the table scanning routine.
*/
/*
* Table element types (for various numbers of ligatures), used
* to facilitate static initializations of tables.
*
* LIGATURE1 and PLIGATURE1 are used as the generic type
*/
TYPEDEF_LIGATURE(1) // LIGATURE1, *PLIGATURE1;
TYPEDEF_LIGATURE(2) // LIGATURE2, *PLIGATURE2;
TYPEDEF_LIGATURE(3) // LIGATURE3, *PLIGATURE3;
TYPEDEF_LIGATURE(4) // LIGATURE4, *PLIGATURE4;
TYPEDEF_LIGATURE(5) // LIGATURE5, *PLIGATURE5;
/***************************************************************************\
* VSC_LPWSTR - associate a Virtual Scancode with a Text string
*
* Uses:
* GetKeyNameText(), aKeyNames[] Map virtual scancode to name of key
*
\***************************************************************************/
typedef struct {
BYTE vsc;
LPWSTR pwsz;
} VSC_LPWSTR, *PVSC_LPWSTR;
/*
* Along with ligature support we';re adding a proper version number.
* The previous version number (actually just unused bits...) was
* always zero. The version number will live in the high word of
* fLocaleFlags.
*/
#define KBD_VERSION 1
#define GET_KBD_VERSION(p) (HIWORD((p)->fLocaleFlags))
/*
* Attributes such as AltGr, LRM_RLM, ShiftLock are stored in the the low word
* of fLocaleFlags (layout specific) or in gdwKeyboardAttributes (all layouts)
*/
#define KLLF_ALTGR 0x0001
#define KLLF_SHIFTLOCK 0x0002
#define KLLF_LRM_RLM 0x0004
/*
* Some attributes are per-layout (specific to an individual layout), some
* attributes are per-user (apply globally to all layouts). Some are both.
*/
#define KLLF_LAYOUT_ATTRS (KLLF_SHIFTLOCK | KLLF_ALTGR | KLLF_LRM_RLM)
#define KLLF_GLOBAL_ATTRS (KLLF_SHIFTLOCK)
/*
* Flags passed in to the KeyboardLayout API (KLF_*) as can be converted to
* internal (KLLF_*) attributes:
*/
#define KLL_ATTR_FROM_KLF(x) ((x) >> 15)
#define KLL_LAYOUT_ATTR_FROM_KLF(x) (KLL_ATTR_FROM_KLF(x) & KLLF_LAYOUT_ATTRS)
#define KLL_GLOBAL_ATTR_FROM_KLF(x) (KLL_ATTR_FROM_KLF(x) & KLLF_GLOBAL_ATTRS)
/*
* If KLF_SHIFTLOCK & KLF_LRM_RLM are defined, we can check the KLLF_* values
*/
#ifdef KLF_SHIFTLOCK
#if KLLF_SHIFTLOCK != KLL_ATTR_FROM_KLF(KLF_SHIFTLOCK)
#error KLLF_SHIFTLOCK != KLL_ATTR_FROM_KLF(KLF_SHIFTLOCK)
#endif
#endif // KLF_SHIFTLOCK
#ifdef KLF_LRM_RLM
#if KLLF_LRM_RLM != KLL_ATTR_FROM_KLF(KLF_LRM_RLM)
#error KLLF_LRM_RLM != KLL_ATTR_FROM_KLF(KLF_LRM_RLM)
#endif
#endif // KLF_LRM_RLM
/***************************************************************************\
* KBDTABLES
*
* This structure describes all the tables that implement the keyboard layer.
*
* When switching to a new layer, we get a new KBDTABLES structure: all key
* processing tables are accessed indirectly through this structure.
*
\***************************************************************************/
typedef struct tagKbdLayer {
/*
* Modifier keys
*/
PMODIFIERS pCharModifiers;
/*
* Characters
*/
VK_TO_WCHAR_TABLE *pVkToWcharTable; // ptr to tbl of ptrs to tbl
/*
* Diacritics
*/
PDEADKEY pDeadKey;
/*
* Names of Keys
*/
VSC_LPWSTR *pKeyNames;
VSC_LPWSTR *pKeyNamesExt;
LPWSTR *pKeyNamesDead;
/*
* Scan codes to Virtual Keys
*/
USHORT *pusVSCtoVK;
BYTE bMaxVSCtoVK;
PVSC_VK pVSCtoVK_E0; // Scancode has E0 prefix
PVSC_VK pVSCtoVK_E1; // Scancode has E1 prefix
/*
* Locale-specific special processing
*/
DWORD fLocaleFlags;
/*
* Ligatures
*/
BYTE nLgMax;
BYTE cbLgEntry;
PLIGATURE1 pLigature;
} KBDTABLES, *PKBDTABLES;
/*
* OEM-specific special processing (keystroke simulators and filters)
*/
extern KEPROC aKEProcOEM[];
/*
* FarEast-specific special...
*/
typedef struct _VK_FUNCTION_PARAM {
BYTE NLSFEProcIndex;
ULONG NLSFEProcParam;
} VK_FPARAM, *PVK_FPARAM;
typedef struct _VK_TO_FUNCTION_TABLE {
BYTE Vk;
BYTE NLSFEProcType;
BYTE NLSFEProcCurrent;
// Index[0] : Base
// Index[1] : Shift
// Index[2] : Control
// Index[3] : Shift+Control
// Index[4] : Alt
// Index[5] : Shift+Alt
// Index[6] : Control+Alt
// Index[7] : Shift+Control+Alt
BYTE NLSFEProcSwitch; // 8 bits
VK_FPARAM NLSFEProc[8];
VK_FPARAM NLSFEProcAlt[8];
} VK_F, *PVK_F;
typedef struct tagKbdNlsLayer {
USHORT OEMIdentifier;
USHORT LayoutIn[form]ation;
UINT NumOfVkToF;
VK_F *pVkToF;
//
// The pusMouseVKey array provides a translation from the virtual key
// value to an index. The index is used to select the appropriate
// routine to process the virtual key, as well as to select extra
// in[form]ation that is used by this routine during its processing.
// If this value is NULL, following default will be used.
//
// ausMouseVKey[] = {
// VK_CLEAR, // Numpad 5: Click active button
// VK_PRIOR, // Numpad 9: Up & Right
// VK_NEXT, // Numpad 3: Down & Right
// VK_END, // Numpad 1: Down & Left
// VK_HOME, // Numpad 7: Up & Left
// VK_LEFT, // Numpad 4: Left
// VK_UP, // Numpad 8: Up
// VK_RIGHT, // Numpad 6: Right
// VK_DOWN, // Numpad 2: Down
// VK_INSERT, // Numpad 0: Active button down
// VK_DELETE, // Numpad .: Active button up
// VK_MULTIPLY, // Numpad *: Select both buttons
// VK_ADD, // Numpad +: Double click active button
// VK_SUBTRACT, // Numpad -: Select right button
// VK_DEVIDE|KBDEXT, // Numpad /: Select left button
// VK_NUMLOCK|KBDEXT}; // Num Lock
//
INT NumOfMouseVKey;
USHORT *pusMouseVKey;
} KBDNLSTABLES, *PKBDNLSTABLES;
//
// OEM Ids - KBDNLSTABLES.OEMIdentifier
//
// PSS ID Number: Q130054
// Article last modified on 05-16-1995
//
// 3.10 1.20 | 3.50 1.20
// WINDOWS | WINDOWS NT
//
// ---------------------------------------------------------------------
// The in[form]ation in this article applies to:
// - Microsoft Windows Software Development Kit (SDK) for Windows
// version 3.1
// - Microsoft Win32 Software Development Kit (SDK) version 3.5
// - Microsoft Win32s version 1.2
// ---------------------------------------------------------------------
// SUMMARY
// =======
// Because of the variety of computer manufacturers (NEC, Fujitsu, IBMJ, and
// so on) in Japan, sometimes Windows-based applications need to know which
// OEM (original equipment manufacturer) manufactured the computer that is
// running the application. This article explains how.
//
// MORE IN[form]ATION
// ================
// There is no documented way to detect the manufacturer of the computer that
// is currently running an application. However, a Windows-based application
// can detect the type of OEM Windows by using the return value of the
// GetKeyboardType() function.
//
// If an application uses the GetKeyboardType API, it can get OEM ID by
// specifying "1" (keyboard subtype) as argument of the function. Each OEM ID
// is listed here:
//
// OEM Windows OEM ID
// ------------------------------
// Microsoft 00H (DOS/V)
// all AX 01H
// EPSON 04H
// Fujitsu 05H
// IBMJ 07H
// Matsushita 0AH
// NEC 0DH
// Toshiba 12H
//
// Application programs can use these OEM IDs to distinguish the type of OEM
// Windows. Note, however, that this method is not documented, so Microsoft
// may not support it in the future version of Windows.
//
// As a rule, application developers should write hardware-independent code,
// especially when making Windows-based applications. If they need to make a
// hardware-dependent application, they must prepare the separated program
// file for each different hardware architecture.
//
// Additional reference words: 3.10 1.20 3.50 1.20 kbinf
// KBCategory: kbhw
// KBSubcategory: wintldev
// =============================================================================
// Copyright Microsoft Corporation 1995.
//
#define NLSKBD_OEM_MICROSOFT 0x00
#define NLSKBD_OEM_AX 0x01
#define NLSKBD_OEM_EPSON 0x04
#define NLSKBD_OEM_FUJITSU 0x05
#define NLSKBD_OEM_IBM 0x07
#define NLSKBD_OEM_MATSUSHITA 0x0A
#define NLSKBD_OEM_NEC 0x0D
#define NLSKBD_OEM_TOSHIBA 0x12
#define NLSKBD_OEM_DEC 0x18 // only NT
//
// Microsoft (default) - keyboards hardware/layout
//
#define MICROSOFT_KBD_101_TYPE 0
#define MICROSOFT_KBD_AX_TYPE 1
#define MICROSOFT_KBD_106_TYPE 2
#define MICROSOFT_KBD_002_TYPE 3
#define MICROSOFT_KBD_001_TYPE 4
#define MICROSOFT_KBD_FUNC 12
//
// AX consortium - keyboards hardware/layout
//
#define AX_KBD_DESKTOP_TYPE 1
//
// Fujitsu - keyboards hardware/layout
//
#define FMR_KBD_JIS_TYPE 0
#define FMR_KBD_OASYS_TYPE 1
#define FMV_KBD_OASYS_TYPE 2
//
// NEC - keyboards hardware/layout
//
#define NEC_KBD_NORMAL_TYPE 1
#define NEC_KBD_N_MODE_TYPE 2
#define NEC_KBD_H_MODE_TYPE 3
#define NEC_KBD_LAPTOP_TYPE 4
#define NEC_KBD_106_TYPE 5
//
// Toshiba - keyboards hardware/layout
//
#define TOSHIBA_KBD_DESKTOP_TYPE 13
#define TOSHIBA_KBD_LAPTOP_TYPE 15
//
// DEC - keyboards hardware/layout
//
#define DEC_KBD_ANSI_LAYOUT_TYPE 1 // only NT
#define DEC_KBD_JIS_LAYOUT_TYPE 2 // only NT
//
// Keyboard layout in[form]ation - KBDNLSTABLE.LayoutIn[form]ation
//
//
// If this flag is on, System sends notification to keyboard
// drivers (leyout/kernel mode). when IME (Input-Mehod-Editor)
// status become changed.
//
#define NLSKBD_INFO_SEND_IME_NOTIFICATION 0x0001
//
// If this flag is on, System will use VK_HOME/VK_KANA instead of
// VK_NUMLOCK/VK_SCROLL for Accessibility toggle keys.
// + Typically, NEC PC-9800 Series will use this bit, because
// they does not have ';NumLock'; and ';ScrollLock'; keys.
//
#define NLSKBD_INFO_ACCESSIBILITY_KEYMAP 0x0002
//
// If this flag is on, System will return 101 or 106 Japanese
// keyboard type/subtype id, when GetKeyboardType() is called.
//
#define NLSKBD_INFO_EMURATE_101_KEYBOARD 0x0010
#define NLSKBD_INFO_EMURATE_106_KEYBOARD 0x0020
//
// Keyboard layout function types
//
// - VK_F.NLSFEProcType
//
#define KBDNLS_TYPE_NULL 0
#define KBDNLS_TYPE_NORMAL 1
#define KBDNLS_TYPE_TOGGLE 2
//
// - VK_F.NLSFEProcCurrent
//
#define KBDNLS_INDEX_NORMAL 1
#define KBDNLS_INDEX_ALT 2
//
// - VK_F.NLSFEProc[]
//
#define KBDNLS_NULL 0 // Invalid function
#define KBDNLS_NOEVENT 1 // Drop keyevent
#define KBDNLS_SEND_BASE_VK 2 // Send Base VK_xxx
#define KBDNLS_SEND_PARAM_VK 3 // Send Parameter VK_xxx
#define KBDNLS_KANALOCK 4 // VK_KANA (with hardware lock)
#define KBDNLS_ALPHANUM 5 // VK_DBE_ALPHANUMERIC
#define KBDNLS_HIRAGANA 6 // VK_DBE_HIRAGANA
#define KBDNLS_KATAKANA 7 // VK_DBE_KATAKANA
#define KBDNLS_SBCSDBCS 8 // VK_DBE_SBCSCHAR/VK_DBE_DBCSCHAR
#define KBDNLS_ROMAN 9 // VK_DBE_ROMAN/VK_DBE_NOROMAN
#define KBDNLS_CODEINPUT 10 // VK_DBE_CODEINPUT/VK_DBE_NOCODEINPUT
#define KBDNLS_HELP_OR_END 11 // VK_HELP or VK_END [NEC PC-9800 Only]
#define KBDNLS_HOME_OR_CLEAR 12 // VK_HOME or VK_CLEAR [NEC PC-9800 Only]
#define KBDNLS_NUMPAD 13 // VK_NUMPAD? for Numpad key [NEC PC-9800 Only]
#define KBDNLS_KANAEVENT 14 // VK_KANA [Fujitsu FMV oyayubi Only]
#define KBDNLS_CONV_OR_NONCONV 15 // VK_CONVERT and VK_NONCONVERT [Fujitsu FMV oyayubi Only]
typedef BOOL (* NLSKEPROC)(PKE pKe, ULONG_PTR dwExtraInfo, ULONG dwParam);
typedef BOOL (* NLSVKFPROC)(PVK_F pVkToF, PKE pKe, ULONG_PTR dwExtraInfo);
//
// Keyboard Type = 7 : Japanese Keyboard
// Keyboard Type = 8 : Korean Keyboard
//
#define JAPANESE_KEYBOARD(Id) ((Id).Type == 7)
#define KOREAN_KEYBOARD(Id) ((Id).Type == 8)
// Fujitsu Oyayubi-shift keyboard
#define FUJITSU_KBD_CONSOLE(Id) (JAPANESE_KEYBOARD(Id) && \
(Id).Subtype == ((NLSKBD_OEM_FUJITSU HELP
#define T59 _EQ( CLEAR )
#define T5A _EQ( OEM_WSCTRL )// WSCtrl
#define T5B _EQ( OEM_FINISH )// Finish
#define T5C _EQ( OEM_JUMP )// Jump
#define T5D _EQ( EREOF )
#define T5E _EQ( OEM_BACKTAB ) // KB3270 UP
#define T79 _EQ( _none_ ) // KB3270 => DELETE
#define T7A _EQ( _none_ ) // KB3270 => INSERT
#define T7B _EQ( OEM_PA1 ) // KB3270
#define T7C _EQ( TAB ) // KB3270 => TAB
#define T7D _EQ( _none_ ) // KB3270 => RIGHT
#define T7E _EQ( ABNT_C2 ) // KB3270 => BACKTAB
#define T7F _EQ( OEM_PA2 ) // KB3270
#define X10 _EQ( MEDIA_PREV_TRACK ) // SpeedRacer
#define X19 _EQ( MEDIA_NEXT_TRACK ) // SpeedRacer
#define X1C _EQ( RETURN )
#define X1D _EQ( RCONTROL )
#define X20 _EQ( VOLUME_MUTE ) // SpeedRacer
#define X21 _EQ( LAUNCH_APP2 ) // SpeedRacer (Calculator?)
#define X22 _EQ( MEDIA_PLAY_PAUSE ) // SpeedRacer
#define X24 _EQ( MEDIA_STOP ) // SpeedRacer
#define X2E _EQ( VOLUME_DOWN ) // SpeedRacer
#define X30 _EQ( VOLUME_UP ) // SpeedRacer
#define X32 _EQ( BROWSER_HOME ) // SpeedRacer
#define X35 _EQ( DIVIDE )
#define X37 _EQ( SNAPSHOT )
#define X38 _EQ( RMENU )
#define X46 _EQ( CANCEL )
#define X47 _EQ( HOME )
#define X48 _EQ( UP )
#define X49 _EQ( PRIOR )
#define X4B _EQ( LEFT )
#define X4D _EQ( RIGHT )
#define X4F _EQ( END )
#define X50 _EQ( DOWN )
#define X51 _NE(NEXT, F1, NEXT, NEXT, _none_, OEM_PA2 )
#define X52 _EQ( INSERT )
#define X53 _EQ( DELETE )
#define X5B _EQ( LWIN )
#define X5C _EQ( RWIN )
#define X5D _EQ( APPS )
#define X5E _EQ( POWER )
#define X5F _EQ( SLEEP ) // SpeedRacer
#define X65 _EQ( BROWSER_SEARCH ) // SpeedRacer
#define X66 _EQ( BROWSER_FAVORITES ) // SpeedRacer
#define X67 _EQ( BROWSER_REFRESH ) // SpeedRacer
#define X68 _EQ( BROWSER_STOP ) // SpeedRacer
#define X69 _EQ( BROWSER_FORWARD ) // SpeedRacer
#define X6A _EQ( BROWSER_BACK ) // SpeedRacer
#define X6B _EQ( LAUNCH_APP1 ) // SpeedRacer (my computer?)
#define X6C _EQ( LAUNCH_MAIL ) // SpeedRacer
#define X6D _EQ( LAUNCH_MEDIA_SELECT ) // SpeedRacer
/*
* The break key is sent to us as E1,LCtrl,NumLock
* We must convert the E1+LCtrl to BREAK, then ignore the Numlock
*/
#define Y1D _EQ( PAUSE )
#elif (KBD_TYPE >= 7) && (KBD_TYPE 20) && (KBD_TYPE = 30) && (KBD_TYPE = 40) && (KBD_TYPE > 16)
#define SCANCODE_NUMPAD_FIRST 0x47
#define SCANCODE_NUMPAD_LAST 0x52
#define SCANCODE_LWIN 0x5B
#define SCANCODE_RWIN 0x5C
#define SCANCODE_THAI_LAYOUT_TOGGLE 0x29
/*
* Hydra FarEast
*/
/*
* Structure for client keyboard in[form]ation
*/
typedef struct _CLIENTKEYBOARDTYPE {
ULONG Type;
ULONG SubType;
ULONG FunctionKey;
} CLIENTKEYBOARDTYPE, *PCLIENTKEYBOARDTYPE;
#endif // _KBD_
|