The mouse has support for adding a custom mouse driver. This can be used to add support for mouses not supported by the standard Free Pascal driver, but also to enhance an existing driver for instance to log mouse events or to implement a record and playback function.
The following unit shows how a mouse driver can be enhanced by adding some logging capabilities to the driver.
Listing: mouseex/logmouse.pp