1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536
|
<?xml version="1.0" encoding="ISO-8859-1"?>
<fpdoc-descriptions>
<!--
$Id: mouse.xml,v 1.1 2004/09/09 20:17:07 michael Exp $
This file is part of the FPC documentation.
Copyright (C) 1997, by Michael Van Canneyt
The FPC documentation is free text; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The FPC Documentation is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the FPC documentation; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
-->
<package name="rtl">
<module name="mouse">
<short>Mouse event handling unit</short>
<!-- \FPCexampledir{mouseex} -->
<descr>
The <file>Mouse</file> 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.
</descr>
<element name="errMouseBase">
<short>Base for mouse error codes.</short>
</element>
<element name="errMouseInitError">
<short>Mouse initialization error</short>
</element>
<element name="errMouseNotImplemented">
<short>Mouse driver not implemented.</short>
</element>
<element name="MouseActionDown">
<short>Mouse button down event signal.</short>
</element>
<element name="MouseActionUp">
<short>Mouse button up event signal.</short>
</element>
<element name="MouseActionMove">
<short>Mouse cursor move event signal.</short>
</element>
<element name="MouseLeftButton">
<short>Left mouse button event.</short>
</element>
<element name="MouseRightButton">
<short>Right mouse button event.</short>
</element>
<element name="MouseMiddleButton">
<short>Middle mouse button event.</short>
</element>
<!-- constant Visibility: default -->
<element name="MouseButton4">
<short>4th mouse button event</short>
</element>
<!-- constant Visibility: default -->
<element name="MouseButton5">
<short>5th mouse button event</short>
</element>
<element name="MouseEventBufSize">
<short>Mouse event buffer size</short>
<descr>
The mouse unit has a mechanism to buffer mouse events. This
constant defines the size of the event buffer.
</descr>
</element>
<element name="PMouseEvent">
<short>Pointer to <link id="TMouseEvent"/> record.</short>
</element>
<element name="TMouseEvent">
<short>Mouse event reporting record.</short>
<descr>
<p>
The <var>TMouseEvent</var> is the central type of the mouse unit, it is used
to describe all mouse events.
</p>
<p>
The <var>Buttons</var> field describes which buttons were down when the event
occurred. The <var>x,y</var> fields describe where the event occurred on the
screen. The <var>Action</var> describes what action was going on when the event
occurred. The <var>Buttons</var> and <var>Action</var> field can be examined using the
constants defined in the unit interface.
</p>
</descr>
<seealso>
<link id="GetMouseEvent"/>
<link id="PollMouseEvent"/>
<link id="PutMouseEvent"/>
</seealso>
</element>
<element name="TMouseEvent.X">
<short>Horizontal position of mouse cursor.</short>
</element>
<element name="TMouseEvent.Y">
<short>Vertical position of mouse cursor.</short>
</element>
<element name="TMouseEvent.Buttons">
<short>Pressed buttons at time of event.</short>
</element>
<element name="TMouseEvent.Action">
<short>Type of event.</short>
</element>
<element name="TMouseDriver">
<short>Mouse driver structure</short>
<descr>
The <var>TMouseDriver</var> record is used to implement a mouse driver in the
<link id="SetMouseDriver"/> function. Its fields must be filled in before
calling the <link id="SetMouseDriver"/> function.
</descr>
<seealso>
<link id="SetMouseDriver"/>
</seealso>
</element>
<element name="TMouseDriver.UseDefaultQueue">
<short>Should the default event queue mechanism be used.</short>
</element>
<element name="TMouseDriver.InitDriver">
<short>Called when the driver must be initialized</short>
</element>
<element name="TMouseDriver.DoneDriver">
<short>Called when the driver will be unloaded.</short>
</element>
<element name="TMouseDriver.DetectMouse">
<short>Function called when the mouse must be detected.</short>
</element>
<element name="TMouseDriver.ShowMouse">
<short>Function called when the mouse cursor must be shown.</short>
</element>
<element name="TMouseDriver.HideMouse">
<short>Function called when the mouse cursor must be hidden.</short>
</element>
<element name="TMouseDriver.GetMouseX">
<short>Called to get the mouse cursors horizontal position.</short>
</element>
<element name="TMouseDriver.GetMouseY">
<short>Called to get the mouse cursors vertical position.</short>
</element>
<element name="TMouseDriver.GetMouseButtons">
<short>Called to get the currently pressed mouse buttons.</short>
</element>
<element name="TMouseDriver.SetMouseXY">
<short>Called when the current mouse position must be set.</short>
</element>
<element name="TMouseDriver.GetMouseEvent">
<short>Called to get the next mouse event. Waits if needed.</short>
</element>
<element name="TMouseDriver.PollMouseEvent">
<short>Called to get the next mouse event. Does not wait.</short>
</element>
<element name="TMouseDriver.PutMouseEvent">
<short>Called to put a mouse event back in the queue.</short>
</element>
<element name="MouseIntFlag">
<short>Internal mouse flag</short>
<descr>This variable keeps track of the last known internal mouse state. Do not use.</descr>
</element>
<element name="MouseButtons">
<short>Mouse button state</short>
<descr>This variable keeps track of the last known mouse button state. Do not use.</descr>
</element>
<element name="MouseWhereX">
<short>Mouse cursor horizontal position</short>
<descr>This variable keeps track of the last known cursor position. Do not use.</descr>
</element>
<element name="MouseWhereY">
<short>Mouse cursor vertical position</short>
<descr>This variable keeps track of the last known cursor position. Do not use.</descr>
</element>
<element name="DetectMouse">
<short>Detect the presence of a mouse.</short>
<descr>
<p>
<var>DetectMouse</var> detects whether a mouse is attached to the system or not.
If there is no mouse, then zero is returned. If a mouse is attached, then
the number of mouse buttons is returned.
</p>
<p>
This function should be called after the mouse driver was initialized.
</p>
</descr>
<errors>
None.
</errors>
<seealso>
<link id="InitMouse"/>
<link id="DoneMouse"/>,
</seealso>
<example file="mouseex/ex1"/>
</element>
<element name="DoneMouse">
<short>Deinitialize mouse driver.</short>
<descr>
<p>
<var>DoneMouse</var> De-initializes the mouse driver. It cleans up any memory
allocated when the mouse was initialized, or removes possible mouse hooks
from memory. The mouse functions will not work after <var>DoneMouse</var> was
called. If <var>DoneMouse</var> is called a second time, it will exit at once.
<var>InitMouse</var> should be called before <var>DoneMouse</var> can be called again.
</p>
<p>
For an example, see most other mouse functions.
</p>
</descr>
<errors>
None.
</errors>
<seealso>
<link id="DetectMouse"/>
<link id="InitMouse"/>
</seealso>
</element>
<element name="GetMouseButtons">
<short>Get the state of the mouse buttons</short>
<descr>
<p>
<var>GetMouseButtons</var> returns the current button state of the mouse, i.e.
it returns a or-ed combination of the following constants:
</p>
<dl>
<dt>MouseLeftButton</dt>
<dd> When the left mouse button is held down.
</dd>
<dt>MouseRightButton</dt>
<dd> When the right mouse button is held down.
</dd>
<dt>MouseMiddleButton</dt>
<dd> When the middle mouse button is held down.
</dd>
</dl>
</descr>
<errors>
None.
</errors>
<seealso>
<link id="GetMouseEvent"/>
<link id="GetMouseX"/>
<link id="GetMouseY"/>
</seealso>
<example file="mouseex/ex2"/>
</element>
<element name="GetMouseDriver">
<short>Get a copy of the currently active mouse driver.</short>
<descr>
<p>
<var>GetMouseDriver</var> returns the currently set mouse driver. It can be used
to retrieve the current mouse driver, and override certain callbacks.
</p>
<p>
A more detailed explanation about getting and setting mouse drivers can be found in
<link id="mousedrv"/>.
</p>
<p>
For an example, see the section on writing a custom mouse driver,
<link id="mousedrv"/>
</p>
</descr>
<errors>
None.
</errors>
<seealso>
<link id="SetMouseDriver"/>
</seealso>
</element>
<element name="GetMouseEvent">
<short>Get next mouse event from the queue.</short>
<descr>
<p>
<var>GetMouseEvent</var> returns the next mouse event (a movement, button press or
button release), and waits for one if none is available in the queue.
</p>
<p>
Some mouse drivers can implement a mouse event queue which can hold multiple
events till they are fetched. Others don't, and in that case, a one-event
queue is implemented for use with <link id="PollMouseEvent"/>.
</p>
</descr>
<errors>
None.
</errors>
<seealso>
<link id="GetMouseButtons"/>
<link id="GetMouseX"/>
<link id="GetMouseY"/>
</seealso>
</element>
<element name="GetMouseX">
<short>Query the current horizontal position of the mouse cursor.</short>
<descr>
<var>GetMouseX</var> returns the current <var>X</var> position of the mouse. <var>X</var> is
measured in characters, starting at 0 for the left side of the screen.
</descr>
<errors>
None.
</errors>
<seealso>
<link id="GetMouseButtons"/>
<link id="GetMouseEvent"/>
<link id="GetMouseY"/>
</seealso>
<example file="mouseex/ex4"/>
</element>
<element name="GetMouseY">
<short>Query the current vertical position of the mouse cursor.</short>
<descr>
<p>
<var>GetMouseY</var> returns the current <var>Y</var> position of the mouse. <var>Y</var> is
measured in characters, starting at 0 for the top of the screen.
</p>
<p>
For an example, see <link id="GetMouseX"/>
</p>
</descr>
<errors>
None.
</errors>
<seealso>
<link id="GetMouseButtons"/>
<link id="GetMouseEvent"/>
<link id="GetMouseX"/>
</seealso>
</element>
<element name="HideMouse">
<short>Hide the mouse cursor.</short>
<descr>
<var>HideMouse</var> hides the mouse cursor. This may or may not be implemented
on all systems, and depends on the driver.
</descr>
<errors>
None.
</errors>
<seealso>
<link id="ShowMouse"/>
</seealso>
<example file="mouseex/ex5"/>
</element>
<element name="InitMouse">
<short>Initialize the FPC mouse driver.</short>
<descr>
<p>
<var>InitMouse</var> Initializes the mouse driver. This will allocate any data
structures needed for the mouse to function. All mouse functions can be
used after a call to <var>InitMouse</var>.
</p>
<p>
A call to <var>InitMouse</var> must always be followed by a call to <link id="DoneMouse"/>
at program exit. Failing to do so may leave the mouse in an unusable state,
or may result in memory leaks.
</p>
<p>
For an example, see most other functions.
</p>
</descr>
<errors>
None.
</errors>
<seealso>
<link id="DoneMouse"/>
<link id="DetectMouse"/>
</seealso>
</element>
<element name="PollMouseEvent">
<short>Query next mouse event. Do not wait if none available.</short>
<descr>
<p>
<var>PollMouseEvent</var> checks whether a mouse event is available, and
returns it in <var>MouseEvent</var> if one is found. The function result is
<var>True</var> in that case. If no mouse event is pending, the function result
is <var>False</var>, and the contents of <var>MouseEvent</var> is undefined.
</p>
<p>
Note that after a call to <var>PollMouseEvent</var>, the event should still
be removed from the mouse event queue with a call to <var>GetMouseEvent</var>.
</p>
</descr>
<errors>
None.
</errors>
<seealso>
<link id="GetMouseEvent"/>
<link id="PutMouseEvent"/>
</seealso>
</element>
<element name="PutMouseEvent">
<short>Put a mouse event in the event queue.</short>
<descr>
<p>
<var>PutMouseEvent</var> adds <var>MouseEvent</var> to the input queue. The next
call to <link id="GetMouseEvent"/> or <var>PollMouseEvent</var> will then return
<var>MouseEvent</var>.
</p>
<p>
Please note that depending on the implementation the mouse event queue
can hold only one value.
</p>
</descr>
<errors>
None.
</errors>
<seealso>
<link id="GetMouseEvent"/>
<link id="PollMouseEvent"/>
</seealso>
</element>
<element name="SetMouseDriver">
<short>Set a new mouse driver.</short>
<descr>
<p>
<var>SetMouseDriver</var> sets the mouse driver to <var>Driver</var>. This function
should be called before <link id="InitMouse"/> is called, or after <var>DoneMouse</var>
is called. If it is called after the mouse has been initialized, it does
nothing.
</p>
<p>
For more information on setting the mouse driver, <link id="mousedrv"/>.
</p>
<p>
For an example, see <link id="mousedrv"/>
</p>
</descr>
<errors>
</errors>
<seealso>
<link id="InitMouse"/>
<link id="DoneMouse"/>
<link id="GetMouseDriver"/>
</seealso>
</element>
<element name="SetMouseXY">
<short>Set the mouse cursor position.</short>
<descr>
<var>SetMouseXY</var> places the mouse cursor on <var>X,Y</var>. X and Y are zero
based character coordinates: <var>0,0</var> is the top-left corner of the screen,
and the position is in character cells (i.e. not in pixels).
</descr>
<errors>
None.
</errors>
<seealso>
<link id="GetMouseX"/>
<link id="GetMouseY"/>
</seealso>
<example file="mouseex/ex7"/>
</element>
<element name="ShowMouse">
<short>Show the mouse cursor.</short>
<descr>
<p>
<var>ShowMouse</var> shows the mouse cursor if it was previously hidden. The
capability to hide or show the mouse cursor depends on the driver.
</p>
<p>
For an example, see <link id="HideMouse"/>
</p>
</descr>
<errors>
None.
</errors>
<seealso>
<link id="HideMouse"/>
</seealso>
</element>
<topic name="mousedrv">
<short>Writing a custom mouse driver</short>
<descr>
<p>
The <file>mouse</file> unit 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.
</p>
<p>
The following unit shows how a mouse driver can be enhanced by adding some
logging capabilities to the driver.
</p>
</descr>
<example file="mouseex/logmouse"/>
</topic>
</module>
</package>
</fpdoc-descriptions>
|