Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- uses
- ...
- , Windows
- , ...
- ;
- type
- TMouseBtnType = (mbLeft, mbMiddle, mbRight);
- const
- MOUSE_BTN_VKEYS: Array [TMouseBtnType] of Integer = (VK_LBUTTON, VK_MBUTTON, VK_RBUTTON);
- (* This function returns true when the specified mouse button is pressed *)
- function IsMouseBtnDown(const AMouseBtn: TMouseBtnType): Boolean;
- begin
- Result := GetAsyncKeyState(MOUSE_BTN_VKEYS[AMouseBtn])
- AND $8000 <> 0;
- end;
- (* This function returns true when any of the mouse button is pressed *)
- function IsMouseBtnDown: Boolean;
- begin
- Result := (GetAsyncKeyState(VK_LBUTTON)
- OR GetAsyncKeyState(VK_MBUTTON)
- OR GetAsyncKeyState(VK_RBUTTON)
- )
- AND $8000 <> 0;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement