Sign in Join
FPDoc Onlineexperiment

Mouse unit

Mouse event handling unit.

The Mouse unit implements a platform independent mouse handling interface. It is implemented identically on all platforms supported by Free Pascal and can be enhanced with custom drivers, should this be needed. It is intended to be used only in text-based screens, for instance in conjunction with the keyboard and video unit. No support for graphical screens is implemented, and there are (currently) no plans to implement this.

Classes and records

TMouseDriverrecordMouse driver structure.
TMouseEventrecordMouse event reporting record.

Procedures and functions

DetectMousefunctionDetect the presence of a mouse.
DoneMouseprocedureDeinitialize mouse driver.
GetMouseButtonsfunctionGet the state of the mouse buttons.
GetMouseDriverprocedureGet a copy of the currently active mouse driver.
GetMouseEventprocedureGet next mouse event from the queue.
GetMouseXfunctionQuery the current horizontal position of the mouse cursor.
GetMouseYfunctionQuery the current vertical position of the mouse cursor.
HideMouseprocedureHide the mouse cursor.
InitMouseprocedureInitialize the FPC mouse driver.
PollMouseEventfunctionQuery next mouse event. Do not wait if none available.
PutMouseEventprocedurePut a mouse event in the event queue.
SetMouseDriverprocedureSet a new mouse driver.
SetMouseXYprocedureSet the mouse cursor position.
ShowMouseprocedureShow the mouse cursor.

Types

PMouseEventtypePointer to record.

Constants

errMouseBaseconstantBase for mouse error codes.
errMouseInitErrorconstantMouse initialization error.
errMouseNotImplementedconstantMouse driver not implemented.
MouseActionDownconstantMouse button down event signal.
MouseActionMoveconstantMouse cursor move event signal.
MouseActionUpconstantMouse button up event signal.
MouseButton4constant4th mouse button event.
MouseButton5constant5th mouse button event.
MouseEventBufSizeconstantMouse event buffer size.
MouseLeftButtonconstantLeft mouse button event.
MouseMiddleButtonconstantMiddle mouse button event.
MouseRightButtonconstantRight mouse button event.
MouseXButton1constant
MouseXButton2constant

Variables

MouseButtonsvariableMouse button state.
MouseIntFlagvariableInternal mouse flag.
MouseWhereXvariableMouse cursor horizontal position.
MouseWhereYvariableMouse cursor vertical position.

Topics

mousedrvtopicWriting a custom mouse driver.

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