windows 字符消息——WM_CHAR

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

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值