37 0x33, 0x34, 0x35, 0x36,
38 0x37, 0x38, 0x39, 0x30,
41 0x51, 0x57, 0x45, 0x52,
42 0x54, 0x59, 0x55, 0x49,
46 0x44, 0x46, 0x47, 0x48,
49 0x5a, 0x58, 0x43, 0x56,
51 0x42, 0x4e, 0x4d, VK_OEM_COMMA,
173{ 0x1e, 0,
'a',
'A', 0,
TRUE },
174{ 0x30, 0,
'b',
'B', 0,
TRUE },
175{ 0x2e, 0,
'c',
'C', 0,
TRUE },
176{ 0x20, 0,
'd',
'D', 0,
TRUE },
177{ 0x12, 0,
'e',
'E', 0,
TRUE },
178{ 0x21, 0,
'f',
'F', 0,
TRUE },
179{ 0x22, 0,
'g',
'G', 0,
TRUE },
180{ 0x23, 0,
'h',
'H', 0,
TRUE },
181{ 0x17, 0,
'i',
'I', 0,
TRUE },
182{ 0x24, 0,
'j',
'J', 0,
TRUE },
183{ 0x25, 0,
'k',
'K', 0,
TRUE },
184{ 0x26, 0,
'l',
'L', 0,
TRUE },
185{ 0x32, 0,
'm',
'M', 0,
TRUE },
186{ 0x31, 0,
'n',
'N', 0,
TRUE },
187{ 0x18, 0,
'o',
'O', 0,
TRUE },
188{ 0x19, 0,
'p',
'P', 0,
TRUE },
189{ 0x10, 0,
'q',
'Q', 0,
TRUE },
190{ 0x13, 0,
'r',
'R', 0,
TRUE },
191{ 0x1f, 0,
's',
'S', 0,
TRUE },
192{ 0x14, 0,
't',
'T', 0,
TRUE },
193{ 0x16, 0,
'u',
'U', 0,
TRUE },
194{ 0x2f, 0,
'v',
'V', 0,
TRUE },
195{ 0x11, 0,
'w',
'W', 0,
TRUE },
196{ 0x2d, 0,
'x',
'X', 0,
TRUE },
197{ 0x15, 0,
'y',
'Y', 0,
TRUE },
198{ 0x2c, 0,
'z',
'Z', 0,
TRUE },
200{ 0x02, 0,
'1',
'!', 0,
FALSE },
201{ 0x03, 0,
'2',
'@', 0,
FALSE },
202{ 0x04, 0,
'3',
'#', 0,
FALSE },
203{ 0x05, 0,
'4',
'$', 0,
FALSE },
204{ 0x06, 0,
'5',
'%', 0,
FALSE },
205{ 0x07, 0,
'6',
'^', 0,
FALSE },
206{ 0x08, 0,
'7',
'&', 0,
FALSE },
207{ 0x09, 0,
'8',
'*', 0,
FALSE },
208{ 0x0a, 0,
'9',
'(', 0,
FALSE },
209{ 0x0b, 0,
'0',
')', 0,
FALSE },
211{ 0x29, 0,
'\'',
'~', 0,
FALSE },
212{ 0x0c, 0,
'-',
'_', 0,
FALSE },
213{ 0x0d, 0,
'=',
'+', 0,
FALSE },
214{ 0x1a, 0,
'[',
'{', 0,
FALSE },
215{ 0x1b, 0,
']',
'}', 0,
FALSE },
216{ 0x2b, 0,
'\\',
'|', 0,
FALSE },
217{ 0x27, 0,
';',
':', 0,
FALSE },
218{ 0x28, 0,
'\'',
'"', 0,
FALSE },
219{ 0x33, 0,
',',
'<', 0,
FALSE },
220{ 0x34, 0,
'.',
'>', 0,
FALSE },
221{ 0x35, 0,
'/',
'?', 0,
FALSE },
223{ 0x4f, 0, 0, 0,
'1',
FALSE },
224{ 0x50, 0, 0, 0,
'2',
FALSE },
225{ 0x51, 0, 0, 0,
'3',
FALSE },
226{ 0x4b, 0, 0, 0,
'4',
FALSE },
227{ 0x4c, 0, 0, 0,
'5',
FALSE },
228{ 0x4d, 0, 0, 0,
'6',
FALSE },
229{ 0x47, 0, 0, 0,
'7',
FALSE },
230{ 0x48, 0, 0, 0,
'8',
FALSE },
231{ 0x49, 0, 0, 0,
'9',
FALSE },
232{ 0x52, 0, 0, 0,
'0',
FALSE },
234{ 0x4a, 0,
'-',
'-', 0,
FALSE },
235{ 0x4e, 0,
'+',
'+', 0,
FALSE },
236{ 0x37, 0,
'*',
'*', 0,
FALSE },
237{ 0x35, 1,
'/',
'/', 0,
FALSE },
238{ 0x53, 0, 0, 0,
'.',
FALSE },
240{ 0x39, 0,
' ',
' ', 0,
FALSE },
242{ 0x1c, 0,
'\r',
'\r', 0,
FALSE },
243{ 0x1c, 1,
'\r',
'\r', 0,
FALSE },
244{ 0x0e, 0, 0x08, 0x08, 0,
FALSE },
246{ 0, 0, 0, 0, 0,
FALSE }
254 DWORD oldState, newState;
259 oldState = newState = *
State;
345 DPRINT1(
"NtDeviceIoControlFile(IOCTL_KEYBOARD_SET_INDICATORS) failed (Status %lx)\n",
Status);
363 DPRINT(
"Numlock, using %x\n",
419 static DWORD dwControlKeyState;
428 Event->wRepeatCount = 1;
434 Event->dwControlKeyState = dwControlKeyState;
440 Event->dwControlKeyState);
444 if (
Event->bKeyDown) {
445 Event->uChar.AsciiChar =
447 Event->dwControlKeyState);
450 Event->uChar.AsciiChar = 0;
#define NT_SUCCESS(StatCode)
static void IntUpdateControlKeyState(HANDLE hConsoleInput, LPDWORD State, PKEYBOARD_INPUT_DATA InputData)
struct _SCANTOASCII * PSCANTOASCII
struct _SCANTOASCII SCANTOASCII
NTSTATUS IntTranslateKey(HANDLE hConsoleInput, PKEYBOARD_INPUT_DATA InputData, KEY_EVENT_RECORD *Event)
static WORD KeyTableEnhanced[]
static UCHAR IntAsciiFromInput(PKEYBOARD_INPUT_DATA InputData, DWORD KeyState)
static DWORD IntVKFromKbdInput(PKEYBOARD_INPUT_DATA InputData, DWORD KeyState)
static WORD KeyTableNumlock[]
SCANTOASCII ScanToAscii[]
static OUT PIO_STATUS_BLOCK IoStatusBlock
NTSYSAPI NTSTATUS NTAPI NtDeviceIoControlFile(IN HANDLE hFile, IN HANDLE hEvent OPTIONAL, IN PIO_APC_ROUTINE IoApcRoutine OPTIONAL, IN PVOID IoApcContext OPTIONAL, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN ULONG DeviceIoControlCode, IN PVOID InBuffer OPTIONAL, IN ULONG InBufferLength, OUT PVOID OutBuffer OPTIONAL, IN ULONG OutBufferLength)
#define KEYBOARD_CAPS_LOCK_ON
#define IOCTL_KEYBOARD_SET_INDICATORS
#define KEYBOARD_SCROLL_LOCK_ON
#define KEYBOARD_NUM_LOCK_ON
static LARGE_INTEGER Counter
#define RtlZeroMemory(Destination, Length)
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
#define LEFT_CTRL_PRESSED
#define RIGHT_CTRL_PRESSED
#define RIGHT_ALT_PRESSED