>> var
>>   KS:Tkeyboardstate;
>> begin
>>   KS[VK_NUMLOCK]:= VK_NUMLOCK AND (NOT 1);
>>   SetKeyboardState(KS);
>> end;

This doesn't seem right... Quick check...

var
  KS :TKeyboardState;
begin
  GetKeyboardState(KS);
  KS[VK_NUMLOCK] := not KS[VK_NUMLOCK];
  SetKeyboardState(KS);
end;

This works and is correct... Since you set the entire array in the set command you
need to retrieve the correct settings before modifying the array and using it to set
the keyboard state...

Likewise with VK_SCROLL and VK_CAPITAL

To turn off an led KS[VK_???] := 0;
to turn on KS[VK_???] := 1;

--
Aaron Scott-Boddendijk
Jump Productions
(07) 838-3371 Voice
(07) 838-3372 Fax


---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to