ReactOS 0.4.15-dev-8102-g108db8f
keytrans.h File Reference
#include <ntddkbd.h>
Include dependency graph for keytrans.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

NTSTATUS IntTranslateKey (HANDLE hConsoleInput, PKEYBOARD_INPUT_DATA InputData, KEY_EVENT_RECORD *Event)
 

Function Documentation

◆ IntTranslateKey()

NTSTATUS IntTranslateKey ( HANDLE  hConsoleInput,
PKEYBOARD_INPUT_DATA  InputData,
KEY_EVENT_RECORD Event 
)

Definition at line 417 of file keytrans.c.

418{
419 static DWORD dwControlKeyState;
420
422
423 if (!(InputData->Flags & KEY_BREAK))
424 Event->bKeyDown = TRUE;
425 else
426 Event->bKeyDown = FALSE;
427
428 Event->wRepeatCount = 1;
429 Event->wVirtualScanCode = InputData->MakeCode;
430
431 DPRINT("Translating: %x\n", InputData->MakeCode);
432
433 IntUpdateControlKeyState(hConsoleInput, &dwControlKeyState, InputData);
434 Event->dwControlKeyState = dwControlKeyState;
435
436 if (InputData->Flags & KEY_E0)
437 Event->dwControlKeyState |= ENHANCED_KEY;
438
439 Event->wVirtualKeyCode = IntVKFromKbdInput(InputData,
440 Event->dwControlKeyState);
441
442 DPRINT("Result: %x\n", Event->wVirtualKeyCode);
443
444 if (Event->bKeyDown) {
445 Event->uChar.AsciiChar =
446 IntAsciiFromInput(InputData,
447 Event->dwControlKeyState);
448 DPRINT("Char: %x\n", Event->uChar.AsciiChar);
449 } else {
450 Event->uChar.AsciiChar = 0;
451 }
452
453 return STATUS_SUCCESS;
454}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
unsigned long DWORD
Definition: ntddk_ex.h:95
static void IntUpdateControlKeyState(HANDLE hConsoleInput, LPDWORD State, PKEYBOARD_INPUT_DATA InputData)
Definition: keytrans.c:251
static UCHAR IntAsciiFromInput(PKEYBOARD_INPUT_DATA InputData, DWORD KeyState)
Definition: keytrans.c:376
static DWORD IntVKFromKbdInput(PKEYBOARD_INPUT_DATA InputData, DWORD KeyState)
Definition: keytrans.c:358
#define KEY_BREAK
Definition: ntddkbd.h:71
#define KEY_E0
Definition: ntddkbd.h:72
#define STATUS_SUCCESS
Definition: shellext.h:65
#define DPRINT
Definition: sndvol32.h:73
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define ENHANCED_KEY
Definition: wincon.h:145

Referenced by PeekConsoleInput(), and ReadConsoleInput().