Come realmete ligar os leds do teclado
Come realmete ligar os leds do teclado
Anonymous
Curtidas 0
Respostas
Anonymous
18/03/2003
ai velho faz isso pra testar se o capslock ou num lock tao ligado....
Var
KeyState : TKeyboardState;
begin
GetKeyboardState(KeyState);
//na linha de baixo ele vai testar se o numlock ta ligado se nao tiver ele
//vai acionar e vai ligar o led do teclado
if (KeyState[VK_NUMLOCK] = 0) then //desligado = 0 ligado 1
KeyState[VK_NUMLOCK] := 1
else KeyState[VK_NUMLOCK] := 0;
SetKeyboardState(KeyState);
End;
Para a tecla Caps Lock basta trocar VK_NUMLOCK por VK_CAPITAL.
Var
KeyState : TKeyboardState;
begin
GetKeyboardState(KeyState);
//na linha de baixo ele vai testar se o numlock ta ligado se nao tiver ele
//vai acionar e vai ligar o led do teclado
if (KeyState[VK_NUMLOCK] = 0) then //desligado = 0 ligado 1
KeyState[VK_NUMLOCK] := 1
else KeyState[VK_NUMLOCK] := 0;
SetKeyboardState(KeyState);
End;
Para a tecla Caps Lock basta trocar VK_NUMLOCK por VK_CAPITAL.
GOSTEI 0