Sign in Join
FPDoc Onlineexperiment

GetMouseButtons function

In unit Mouse

Get the state of the mouse buttons.

Declaration

pascal
function GetMouseButtons: Word

Description

GetMouseButtons returns the current button state of the mouse, i.e. it returns a or-ed combination of the following constants:

MouseLeftButton
When the left mouse button is held down.
MouseRightButton
When the right mouse button is held down.
MouseMiddleButton
When the middle mouse button is held down.

Errors

None.

See also

Example: ex2

pascal
Program Example2;

{ Program to demonstrate the GetMouseButtons function. }

Uses mouse;

begin
  InitMouse;
  Writeln('Press right mouse button to exit program');
  While (GetMouseButtons<>MouseRightButton) do ;
  DoneMouse;
end.

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.