[next] [prev] [prev-tail] [tail] [up]

## Chapter 16
The MsMouse unit

The msmouse unit provides basic mouse handling under D O S (Go32v1 and Go32v2) Some general remarks about the msmouse unit:

- For maximum portability, it is advisable to use the mouse unit; that unit is portable across platforms, and offers a similar interface. Under no circumstances should the two units be used together.
- The mouse driver does not know when the text screen scrolls. This results in unerased mouse cursors on the screen when the screen scrolls while the mouse cursor is visible. The solution is to hide the mouse cursor (using HideMouse) when you write something to the screen and to show it again afterwards (using ShowMouse).
- All Functions/Procedures that return and/or accept coordinates of the mouse cursor, always do so in pixels and zero based (so the upper left corner of the screen is (0,0)). To get the (column, row) in standard text mode, divide both x and y by 8 (and add 1 if you want to have it 1 based).
- The real resolution of graphic modes and the one the mouse driver uses can differ. For example, mode 13h (320*200 pixels) is handled by the mouse driver as 640*200, so you will have to multiply the X coordinates you give to the driver and divide the ones you get from it by 2 in that mode.
- By default the msmouse unit is compiled with the conditional define MouseCheck. This causes every procedure/function of the unit to check the MouseFound variable prior to doing anything. Of course this is not necessary, so if you are sure you are not calling any mouse unit procedures when no mouse is found, you can recompile the mouse unit without this conditional define.
- You will notice that several procedures/functions have longint sized parameters while only the lower 16 bits are used. This is because FPC is a 32 bit compiler and consequently 32 bit parameters result in faster code.

16.1 Constants, types and variables
16.2 Functions and procedures
GetLastButtonPress
GetLastButtonRelease
GetMouseState
HideMouse
InitMouse
LPressed
MPressed
RPressed
SetMouseAscii
SetMouseHideWindow
SetMousePos
SetMouseShape
SetMouseSpeed
SetMouseWindow
SetMouseXRange
SetMouseYRange
ShowMouse

[next] [prev] [prev-tail] [front] [up]