How to check the status of the key?

  • one
    GetKeyboardState - Nofate
  • one
    GetKeyState (int) - more specifically, it seems, will be? - BuilderC
  • Or the same, but Async. Send 256 bytes for the sake of one button - in Indian. - karmadro4
  • And more precisely you can, I need to know if the key is pressed !!! - delphikettle

2 answers 2

You can also "remove scan" of the state of all keyboard keys:

... var kb: TKeyBoardState; begin GetKeyboardState(kb); if(kb[VK_LEFT]=1) then begin kb[VK_LEFT]:=0; SetKeyboardState(kb); showmessage(''); end; ... 
     if GetKeyState({код клавиши, типо VK_ESCAPE})=0 then begin {Делаем что надо} end;