As far as I know, there is not a way to interrogate the keyboard directly
from .NET. You can, however, use the GetKeyState( ) Windows API. Here is
the declaration:
Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As
Long
A function to give you the state of the scroll lock key:
Private Function IsScrollLockOn( ) As Boolean
Return Convert.ToBoolean(GetKeyState(Keys.Scroll) Mod 2)
End Function
I should have mentioined the fact that I'm using C# .Net. This appears to
be another language like Visual Basic. I am unable to figure out how to
duplicate what you have done in VB in C#. If anyone can help me do the same
in C# I'd be very gratefull. Thanks.
Brandon
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.