我用UINT MapVirtualKey()把一个字母“A”的虚拟键值转换为扫描码:UINT i = MapVirtualKey(0x41, 0);这时i的值是多少??大写A和小写a的虚拟键值都是0x41,这个函数怎么判断并把它转换为相应的扫描码?当用这个函数把虚拟键值转换为ASC2码时也是一样,它怎么区分大小写?我现在想把一个ASC2码转换为扫描码,能不能请各位高手写一下转化过程!!谢谢!!
解决方案 »
- 弹出窗口顶不到魔兽窗口的最上面
- 请高手指点,为什么程序界面修改后,重新编译却没有变化?不胜感激!!!!
- 跪求:谁知道 visual c++ 技术内幕(潘爱民)第四版的下载地址
- 我没有用MFC,直接SDK的,但是TAB那个控件怎么用不了呢?用了就显示不出来了窗口~
- 关于tabcontrol控件的问题!在线等待!~
- 串口通讯的问题,向串口发送一字符串,包括0,怎么发送?急!!!
- TransparentBlt(...)这个函数是做什么用的啊?
- 下面代码为什么提示指针的错 ??
- 请问大虾什么软件可以编辑pdf文件?谢谢了!
- 在MFC工程里可以使用Platform SDK: Windows Multimedia里的DWORD timeGetTime(VOID)(在Mmsystem.h中定义的)函数吗?
- 如何在MFC源码中加入自己的调试信息
- 关于扫描码、虚拟键值和ASC2码之间的转换关系??(急)
WM_KEYDOWN
The WM_KEYDOWN message is posted to the window with the keyboard focus when a nonsystem key is pressed. A nonsystem key is a key that is pressed when the alt key is not pressed. WM_KEYDOWN
nVirtKey = (int) wParam; // virtual-key code
lKeyData = lParam; // key data
Parameters
nVirtKey
Value of wParam. Specifies the virtual-key code of the nonsystem key.
lKeyData
Value of lParam. Specifies the repeat count, scan code, extended-key flag, context code, previous key-state flag, and transition-state flag, as shown in the following table. Value Description
0–15 Specifies the repeat count for the current message. The value is the number of times the keystroke is auto-repeated 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–23 Specifies the scan code. The value depends on the original equipment manufacturer (OEM).
24 Specifies 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.
25–28 Reserved; do not use.
29 Specifies the context code. The value is always 0 for a WM_KEYDOWN message.
30 Specifies 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.
31 Specifies the transition state. The value is always 0 for a WM_KEYDOWN message.