WM_CHAR
主要用于键盘字符按下的消息,A-Z
#define WM_CHAR 0x0102
Parameters
- wParam
The character code of the key.
字符对应的ASCII值
- lParam
The repeat count, scan code, extended-key flag, context code, previous key-state flag, and transition-state flag, as shown in the following table.
Bits Meaning
指示按键状态信息,32位。
0-15 The repeat count for the current message. The value is the number of times the keystroke is autorepeated as a result of the user holding down the key. If the keystroke is held long enough, multiple messages are sent. However, the repeat count is not cumulative.
低16位表示按键重复次数,当长按某一按键时,多次触发消息
16-23 The scan code. The value depends on the OEM.
OEM扫描码是键盘发送的码值,由于此域是设备相关的,因而此值往往被忽略。
24 Indicates whether the key is an extended key, such as the right-hand ALT and CTRL keys that appear on an enhanced 101- or 102-key keyboard. The value is 1 if it is an extended key; otherwise, it is 0.
扩展键标志在有Alt键(或Ctrl键)按下时为1,否则为0
25-28 Reserved; do not use.
系统保留
29 The context code. The value is 1 if the ALT key is held down while the key is pressed; otherwise, the value is 0.
标志Alt键是否保持按下
30 The previous key state. The value is 1 if the key is down before the message is sent, or it is 0 if the key is up.
消息发送时,键盘的前一个状态,WM_SYSKEYDOWN消息该值一直为0
31 The transition state. The value is 1 if the key is being released, or it is 0 if the key is being pressed.
转换状态。保持释放时为1,保持按压时为0