Sign in Join
FPDoc Onlineexperiment

DetectMouse function

In unit Mouse

Detect the presence of a mouse.

Declaration

pascal
function DetectMouse: Byte

Description

DetectMouse detects whether a mouse is attached to the system or not. If there is no mouse, then zero is returned. If a mouse is attached, then the number of mouse buttons is returned.

This function should be called after the mouse driver was initialized.

Errors

None.

See also

Example: ex1

pascal
Program Example1;

{ Program to demonstrate the DetectMouse function. }

Uses mouse;

Var
  Buttons : Byte;

begin
  InitMouse;
  Buttons:=DetectMouse;
  If Buttons=0 then
    Writeln('No mouse present.')
  else
    Writeln('Found mouse with ',Buttons,' buttons.');
  DoneMouse;
end.

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