当我按键时扫描代码是不同的。微软的规范有错吗?
我使用的是 Windows XP pro SP3。标准英文键盘。我住在美国;从来没有碰过键盘设置。库存安装。因此,当我按检查我的程序返回的扫描码时,它们如下:
A = 30
S = 31
D = 32
F = 33
G = 34
当我检查微软规范(文档第11页:: http://download.microsoft.com/download/1/6/1/161ba512-40e2-4cc9-843a-923143f3456c/scancode.doc )它说:
A = 31
S = 32
D = 33
F = 34
G = 35
他们落后了 1!有什么想法吗?
I am using Windows XP pro SP3. Standard english keyboard. I live in the USA; never touched the keyboard settings. Stock install. So, when I press check the scancodes my program is returning they are as follows:
A = 30
S = 31
D = 32
F = 33
G = 34
When I check the microsoft specification (page 11 of the document:: http://download.microsoft.com/download/1/6/1/161ba512-40e2-4cc9-843a-923143f3456c/scancode.doc ) It says:
A = 31
S = 32
D = 33
F = 34
G = 35
They are off by 1! Any ideas why?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您引用的 Microsoft 键盘扫描代码规范有六列。对于A键:
键位置:31
键盘:A
扫描 1 品牌:1E
扫描 1 中断:9E
扫描 2 品牌:1C
扫描 2 中断:F0 1C
看起来“扫描 2”集是与原始 IBM PC 扫描代码(“扫描 1”)不同的备用硬件扫描代码。请注意,“关键位置”是 31,“扫描 1 make”是 30。这可能有助于解释您在最初发布的值中看到的内容。也许您可以尝试查看 Esc 和 ` 等键,它们在每组中都非常不同(而不仅仅是相差一个,我认为这是误导性的)。
您没有说明您使用哪个 API 或 Windows 消息来获取您报告的扫描代码值,但如果您查看详细文档以了解您所使用的任何内容,您可能会找到更多信息。
The Microsoft Keyboard Scan Code Specification you quoted has six columns. For the A key:
key location: 31
keyboard: A
scan 1 make: 1E
scan 1 break: 9E
scan 2 make: 1C
scan 2 break: F0 1C
It looks like that "scan 2" set is an alternate hardware scan code that's different from the original IBM PC scan code ("scan 1"). Note that the "key location" is 31 and the "scan 1 make" is 30. This might help explain what you're seeing with the values you originally posted. Perhaps you could try looking at keys such as Esc and ` that are quite different in each set (and not just off by one, which I think is misleading).
You didn't say which API or Windows message you were using to get the scan code values you reported, but if you look in the detailed documentation for whatever you're using you might find more information.
您能确定是键盘硬件层面有问题还是键盘驱动程序有问题?
Is the keyboard faulty at the hardware level or there is a problem with the keyboard driver can you ascertain?