How to check the status of the key?
- oneGetKeyboardState - Nofate ♦
- oneGetKeyState (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
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;
|