keybd_event KEYEVENTF_EXTENDED需要键说明 [英] keybd_event KEYEVENTF_EXTENDEDKEY explanation required
问题描述
在文档中它说:
KEYEVENTF_EXTENDEDKEY (0x0001):如果指定,则在扫描代码之前加上前缀字节,其值为0xE0(224).
KEYEVENTF_EXTENDEDKEY (0x0001): If specified, the scan code was preceded by a prefix byte having the value 0xE0 (224).
有人可以解释这是什么意思吗?
Can someone explain what this means?
这有什么区别:
keybd_event(RIGHT, 0, 0, 0);
keybd_event(RIGHT, 0, 2, 0);
和这个:
keybd_event(RIGHT, 0, 1 | 0, 0);
keybd_event(RIGHT, 0, 1 | 2, 0);
因为当我执行这段代码时,我看不出没有区别吗?
because when I execute this code I can't see no difference?
此外,"byte bScan"的用途是什么?在描述中为:密钥的硬件扫描代码.那是什么意思?
Also, what is "byte bScan" for? In description it is: A hardware scan code for the key. What that means?
推荐答案
简单(且不完整)的解释是KEYEVENTF_EXTENDEDKEY的意思是此击键来自数字小键盘"
The simple (and incomplete) explanation is that KEYEVENTF_EXTENDEDKEY means "this keystroke is from the numeric keypad"
由于大多数程序的行为与在数字键盘(扩展键)上按"1"时在"q"键上方按"1"时的行为相同-通常,您不会期望看到在模拟键盘输入时设置此标志时没有任何区别.
Since most programs behave the same if you hit '1' above the 'q' key as they do when you hit '1' on the numeric keypad (which is an extended key) - you wouldn't normally expect to see any difference when you set this flag when simulating keyboard input.
注意键的位置的程序通常会对此标志做出响应.
Programs that pay attention to the location of a key will usually respond to this flag.
bScan值是原始硬件扫描代码.有关扫描代码的说明,请参见 http://en.wikipedia.org/wiki/Scancode .像扩展键标志一样,大多数程序都不关注扫描代码.如果程序希望将键盘视为一堆按钮,则可以使用这些值.
The bScan value is a raw hardware scancode. For an explanation of scancodes look here http://en.wikipedia.org/wiki/Scancode. Like the Extended key flag, most programs pay no attention to scancodes. The values are there in case the program wants to treat the keyboard as a bunch of buttons.
这篇关于keybd_event KEYEVENTF_EXTENDED需要键说明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!