`RAWINPUT::header::wParam` 包含什么用于键盘输入

What does `RAWINPUT::header::wParam` contain for keyboard input

在查看 RAWINPUT 结构的 MSDN 文档时,它有以下声明:

typedef struct tagRAWINPUT {
  RAWINPUTHEADER header;
  union {
    RAWMOUSE    mouse;
    RAWKEYBOARD keyboard;
    RAWHID      hid;
  } data;
} RAWINPUT, *PRAWINPUT, *LPRAWINPUT;

此外,RAWINPUTHEADER 结构包含这些:

typedef struct tagRAWINPUTHEADER {
  DWORD  dwType;
  DWORD  dwSize;
  HANDLE hDevice;
  WPARAM wParam;
} RAWINPUTHEADER, *PRAWINPUTHEADER;

其中感兴趣的是成员wParam:

wParam

Type: WPARAM

The value passed in the wParam parameter of the WM_INPUT message.

那么,这个wParam到底包含什么? (专门针对键盘KEYDOWN输入?)

WM_INPUT 的文档告诉您以下信息:

wParam
The input code. This parameter can be one of the following values.

RIM_INPUT
0
Input occurred while the application was in the foreground. The application must call DefWindowProc so the system can perform cleanup.

RIM_INPUTSINK
1
Input occurred while the application was not in the foreground. The application must call DefWindowProc so the system can perform the cleanup.