-
Scroll Lock light
Hello,
I am writing a program which does something once the scroll lock key is pressed. It then turns off the scroll lock light using the following code:
Code:
Private Sub ScrollLockOff()
Dim abytBuffer(0 To 255) As Byte
GetKeyboardState abytBuffer(0)
abytBuffer(VK_SCROLL) = CByte(False)
SetKeyboardState abytBuffer(0)
End Sub
The problem is this does not seem to turn scroll lock off, it only turns off the light. If I press and hold another key (shift for example) and scroll lock is supposed to be on (but turned off by this code) the scroll lock light starts flashing.
Is there anything else I need to do to turn scroll lock off completely?
-
I think I have found the cause of this problem. It only occurs when the window is not active. However, I would like to run this program in the background. Is there any way to turn scroll lock off when the window is not active?
-
*bump*
Anyone? I need to set the keyboard state, but my window is not the active window. Is this possible?
-