2
$Id: mouseh.inc,v 1.3 2002/09/07 15:07:45 peter Exp $
3
This file is part of the Free Pascal run time library.
4
Copyright (c) 1999-2000 by the Free Pascal development team
6
See the file COPYING.FPC, included in this distribution,
7
for details about the copyright.
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
**********************************************************************}
16
{ We have an errorcode base of 1030 }
18
errMouseInitError = errMouseBase + 0;
19
errMouseNotImplemented = errMouseBase + 1;
22
PMouseEvent=^TMouseEvent;
23
TMouseEvent=packed record { 8 bytes }
30
MouseActionDown = $0001; { Mouse down event }
31
MouseActionUp = $0002; { Mouse up event }
32
MouseActionMove = $0004; { Mouse move event }
34
MouseLeftButton = $01; { Left mouse button }
35
MouseRightButton = $02; { Right mouse button }
36
MouseMiddleButton = $04; { Middle mouse button }
38
MouseEventBufSize = 16; { Size of event queue }
41
MouseIntFlag : Byte; { Mouse in int flag }
42
MouseButtons : Byte; { Mouse button state }
44
MouseWhereY : Word; { Mouse position }
48
UseDefaultQueue : Boolean;
49
InitDriver : Procedure;
50
DoneDriver : Procedure;
51
DetectMouse : Function : Byte;
52
ShowMouse : Procedure;
53
HideMouse : Procedure;
54
GetMouseX : Function : Word;
55
GetMouseY : Function : Word;
56
GetMouseButtons : Function : Word;
57
SetMouseXY : procedure (x,y:word);
58
GetMouseEvent : procedure (var MouseEvent:TMouseEvent);
59
PollMouseEvent : function (var MouseEvent: TMouseEvent):boolean;
60
PutMouseEvent : procedure (Const MouseEvent:TMouseEvent);
64
{ Initialize the mouse interface }
67
{ Deinitialize the mouse interface }
69
function DetectMouse:byte;
70
{ Detect if a mouse is present, returns the amount of buttons or 0
71
if no mouse is found }
74
{ Show the mouse cursor }
77
{ Hide the mouse cursor }
79
function GetMouseX:word;
80
{ Return the current X position of the mouse }
82
function GetMouseY:word;
83
{ Return the current Y position of the mouse }
85
function GetMouseButtons:word;
86
{ Return the current button state of the mouse }
88
procedure SetMouseXY(x,y:word);
89
{ Place the mouse cursor on x,y }
91
procedure GetMouseEvent(var MouseEvent:TMouseEvent);
92
{ Returns the last Mouseevent, and waits for one if not available }
94
procedure PutMouseEvent(const MouseEvent: TMouseEvent);
95
{ Adds the given MouseEvent to the input queue. Please note that depending on
96
the implementation this can hold only one value (NO FIFOs etc) }
98
function PollMouseEvent(var MouseEvent: TMouseEvent):boolean;
99
{ Checks if a Mouseevent is available, and returns it if one is found. If no
100
event is pending, it returns 0 }
102
Procedure SetMouseDriver(Const Driver : TMouseDriver);
103
{ Sets the mouse driver. }
105
Procedure GetMouseDriver(Var Driver : TMouseDriver);
106
{ Returns the currently active mouse driver }
110
Revision 1.3 2002/09/07 15:07:45 peter
111
* old logs removed and tabs fixed