Posted on

delphi key state

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;
Leave a Reply

Your email address will not be published. Required fields are marked *

 

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