Cal,
Is the value of "Keys.something" exactly the
same a the virtual key code o "something"?
According to Charles Petzold's book "Programming Microsoft Windows With
Microsoft Visual Basic .NET" from MS Press it is.
The Keys Enum is all the valid virtual key that you can pass to
GetAsyncKeyState, which means you can use it to check for Function Keys,
Caps Lock, Scroll Lock and other and any other non-char key you want.
I was originally going to give you:
Declare Auto Function GetKeyState Lib "user32.dll" (ByVal vKey As Char)
As Short
Declare Auto Function GetAsyncKeyState Lib "user32.dll" (ByVal vKey As
Char) As Short
However you would have problems trying to check for CapsLock and you would
have to be certain to use only upper case letters. You could also make vKey
as Short, however then you would need to know all the "magic" numbers, Keys
Enum just happens to define all the magic numbers for you. I find using an
existing Enum or defining my own Enum very beneficial when defining API
calls...
Hope this helps
Jay