在查看 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.
关于c++ - `RAWINPUT::header::wParam`包含什么用于键盘输入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32664747/