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
TMouseDriver | record | Mouse driver structure. |
TMouseEvent | record | Mouse event reporting record. |
Procedures and functions
DetectMouse | function | Detect the presence of a mouse. |
DoneMouse | procedure | Deinitialize mouse driver. |
GetMouseButtons | function | Get the state of the mouse buttons. |
GetMouseDriver | procedure | Get a copy of the currently active mouse driver. |
GetMouseEvent | procedure | Get next mouse event from the queue. |
GetMouseX | function | Query the current horizontal position of the mouse cursor. |
GetMouseY | function | Query the current vertical position of the mouse cursor. |
HideMouse | procedure | Hide the mouse cursor. |
InitMouse | procedure | Initialize the FPC mouse driver. |
PollMouseEvent | function | Query next mouse event. Do not wait if none available. |
PutMouseEvent | procedure | Put a mouse event in the event queue. |
SetMouseDriver | procedure | Set a new mouse driver. |
SetMouseXY | procedure | Set the mouse cursor position. |
ShowMouse | procedure | Show the mouse cursor. |
Types
PMouseEvent | type | Pointer to record. |
Constants
errMouseBase | constant | Base for mouse error codes. |
errMouseInitError | constant | Mouse initialization error. |
errMouseNotImplemented | constant | Mouse driver not implemented. |
MouseActionDown | constant | Mouse button down event signal. |
MouseActionMove | constant | Mouse cursor move event signal. |
MouseActionUp | constant | Mouse button up event signal. |
MouseButton4 | constant | 4th mouse button event. |
MouseButton5 | constant | 5th mouse button event. |
MouseEventBufSize | constant | Mouse event buffer size. |
MouseLeftButton | constant | Left mouse button event. |
MouseMiddleButton | constant | Middle mouse button event. |
MouseRightButton | constant | Right mouse button event. |
MouseXButton1 | constant | |
MouseXButton2 | constant |
Variables
MouseButtons | variable | Mouse button state. |
MouseIntFlag | variable | Internal mouse flag. |
MouseWhereX | variable | Mouse cursor horizontal position. |
MouseWhereY | variable | Mouse cursor vertical position. |
Topics
mousedrv | topic | Writing a custom mouse driver. |
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
