首页  编辑  

如何知道鼠标按键是否一直按着

Tags: /超级猛料/Hardware.硬件相关/键盘和鼠标/   Date Created:

procedure TForm1.Timer1Timer(Sender: TObject);

var keystate:TKeyboardState;

begin

 caption:='';

 GetKeyboardState(keystate);

 if keystate[vk_lbutton] and $80 <>0 then

   caption:='lbutton down';

 if keystate[vk_rbutton] and $80 <>0 then

   caption:='Rbutton down';

end;