ReactOS  0.4.14-dev-49-gfb4591c
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 }
static void IntUpdateControlKeyState(HANDLE hConsoleInput, LPDWORD State, PKEYBOARD_INPUT_DATA InputData)
Definition: keytrans.c:251
#define TRUE
Definition: types.h:120
static UCHAR IntAsciiFromInput(PKEYBOARD_INPUT_DATA InputData, DWORD KeyState)
Definition: keytrans.c:376
#define KEY_BREAK
Definition: ntddkbd.h:71
void DPRINT(...)
Definition: polytest.cpp:61
#define ENHANCED_KEY
Definition: wincon.h:139
unsigned long DWORD
Definition: ntddk_ex.h:95
#define KEY_E0
Definition: ntddkbd.h:72
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
static DWORD IntVKFromKbdInput(PKEYBOARD_INPUT_DATA InputData, DWORD KeyState)
Definition: keytrans.c:358
return STATUS_SUCCESS
Definition: btrfs.c:2966

Referenced by PeekConsoleInput(), and ReadConsoleInput().