bbesase
bbesase

Reputation: 861

Virtual Keyboard commands

I was just wondering what the difference between the virtual these keyboard commands is:

KEYEVENTF_EXTENDEDKEY and KEYEVENTF_KEYUP is.

Everywhere I have looked it just gives me a description based off integers and what not but I just want to know simply what each of them does.

Upvotes: 0

Views: 506

Answers (1)

Cody Gray
Cody Gray

Reputation: 244722

You've tagged the question VB.NET, but these actually have nothing at all to do with VB.NET. They're constants defined in the Windows header files, for use with Win32 API functions.

As far as the difference, you can't tell much by looking at their values. The individual values are not particularly important, that's why the named identifiers are used. What's important is where they are used and what the documentation for those functions tells you that they mean.

The first one, KEYEVENTF_EXTENDEDKEY, is used with the KEYBDINPUT structure (which is used along with e.g. the SendInput function) to pass information about synthesized keyboard input. If this flag is used, it means that the scan code should be interpreted as an extended key. Technically, this means that the scan code is preceded by a prefix byte with the value 224 (&HE0 in hexadecimal notation).

The second one, KEYEVENTF_KEYUP, is another one of the flags available for use with this structure. It means that the key is being released (going up), rather than pressed (going down).

There is a general overview of keyboard input available here on MSDN. It explains in more detail what a virtual key code is, what an extended key is, etc.

Upvotes: 4

Related Questions