Posted on Leave a comment

delphi key state

[code language=”delphi”]
procedure TForm1.Button1Click(Sender: TObject);
var
KeyState : Word;
S : String;
begin
KeyState := GetKeyState(VK_SCROLL);
S := ‘Клавиша: VK_SCROLL. Состояние:’;
if KeyState and $8000 = $8000 then
S := s+’down’
else
S := s+’up’;
if KeyState and 1 = 1 then
S := S + ‘toggle on’
else
S := S + ‘toggle off’
;
ShowMessage( S );
end;
[/code]

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.