by Nidhi (2 Submissions)
Category: Windows API Call/Explanation
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Tue 29th July 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Keyboard Lights On And Off
API Declarations
Private Declare Function SetKeyboardState Lib "user32" Alias "SetKeyboardState" (lppbKeyState As Byte) As Long
Private Const VK_CAPITAL = &H14
Private Const VK_NUMLOCK = &H90
redim keyboard buffer(256) as byte
get keyboardstate keyboardbuffer(0)
if keyboardbuffer(vk_capital) and 1 then
keyboardbuffer(vk_capital)=0
else
keyboardbuffer(vk_capital)=1
end if
if keyboardbuffer(vk_numlock) and 1 then
keyboardbuffer(vk_numlockl)=0
else
keyboardbuffer(vk_numlockl)=1
end if
set keyboardstate keyboardbuffer(0)
end sub