CAPS NUM SCROLL

Max,
  You can use this to set the CAPS, NUM, SCROLL Lock keys but it is only
local to your program and from what I understand will only turn on the
lights on some keyboards (the help says it won't but it does on my Gateway
2000 keyboard.) Not sure if you can set it globally.

procedure TForm1.Button1Click(Sender: TObject);
var
  Buf: TKeyBoardState;
begin
  GetKeyBoardState(Buf);
  Buf[VK_SCROLL] := Buf[VK_SCROLL] xor 1;
  SetKeyBoardState(Buf);
end;

VK_SCROLL  ->   Scroll Lock
VK_NUMLOCK  ->  Num Lock
VK_CAPITAL  ->  Caps Lock

To check if they are on or not you can use something like:

if LoWord(GetKeyState(VK_CAPITAL)) = 1 then
    Label1.Caption := 'Caps Lock is On'
  else
    Label1.Caption := 'Caps Lock is Off';

Hope this helps!
--

Rodney E Geraghty
GERA-Tech
Ottawa, Canada
gera...@ibm.net

m...@actcom.co.il wrote in article <33FFE2D3.6...@actcom.co.il>...

Quote
> Hi all!
> Does somebody know how to set\get the Caps Num and SCROLL lock states
> programatically?

> Thanks in advance, MaxP.