mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-17 12:59:24 +02:00
+ Initial check-in
This commit is contained in:
parent
d9ce3626e5
commit
b941c2d82f
667
docs/crt.xml
Normal file
667
docs/crt.xml
Normal file
@ -0,0 +1,667 @@
|
||||
<?xml version="1.0" encoding="ISO8859-1"?>
|
||||
<fpdoc-descriptions>
|
||||
<!--
|
||||
|
||||
$Id$
|
||||
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="crt">
|
||||
<short>CRT - Turbo Pascal screen and keyboard handling unit</short>
|
||||
<!-- \FPCexampledir{crtex} -->
|
||||
<descr>
|
||||
<p>
|
||||
This chapter describes the <var>CRT</var> unit for Free Pascal, both under dos
|
||||
linux and Windows. The unit was first written for dos by Florian klaempfl.
|
||||
The unit was ported to linux by Mark May and enhanced by Michael Van Canneyt
|
||||
and Peter Vreman. It works on the linux console, and in xterm and rxvt windows
|
||||
under X-Windows. The functionality for both is the same, except that under
|
||||
linux the use of an early implementation (versions 0.9.1 and earlier of the
|
||||
compiler) the crt unit automatically cleared the screen at program startup.
|
||||
</p>
|
||||
<p>
|
||||
There are some caveats when using the CRT unit:
|
||||
</p>
|
||||
<ul>
|
||||
<li> Programs using the CRT unit will <em> not</em> be usable when input/output
|
||||
is being redirected on the command-line.
|
||||
</li>
|
||||
<li> For similar reasons they are not usable as CGI-scripts for use with a
|
||||
webserver.
|
||||
</li>
|
||||
<li> The use of the CRT unit and the graph unit may not always be supported.
|
||||
</li>
|
||||
<li> On linux or other unix OSes , executing other programs that expect
|
||||
special terminal behaviour (using one of the special functions in the linux
|
||||
unit) will not work. The terminal is set in RAW mode, which will destroy
|
||||
most terminal emulation settings.
|
||||
</li>
|
||||
</ul>
|
||||
</descr>
|
||||
|
||||
<element name="Black">
|
||||
<short>Black color attribute</short>
|
||||
</element>
|
||||
|
||||
<element name="Blue">
|
||||
<short>Blue color attribute</short>
|
||||
</element>
|
||||
|
||||
<element name="Green">
|
||||
<short>Green color attribute</short>
|
||||
</element>
|
||||
|
||||
<element name="Cyan">
|
||||
<short>Cyan color attribute</short>
|
||||
</element>
|
||||
|
||||
<element name="Red">
|
||||
<short>Red color attribute</short>
|
||||
</element>
|
||||
|
||||
<element name="Magenta">
|
||||
<short>Magenta color attribute</short>
|
||||
</element>
|
||||
|
||||
<element name="Brown">
|
||||
<short>Brown color attribute</short>
|
||||
</element>
|
||||
|
||||
<element name="LightGray">
|
||||
<short>Light gray color attribute</short>
|
||||
</element>
|
||||
|
||||
<element name="DarkGray">
|
||||
<short>Dark gray color attribute</short>
|
||||
</element>
|
||||
|
||||
<element name="LightBlue">
|
||||
<short>Light Blue color attribute</short>
|
||||
</element>
|
||||
|
||||
<element name="LightGreen">
|
||||
<short>Light green color attribute</short>
|
||||
</element>
|
||||
|
||||
<element name="LightCyan">
|
||||
<short>Light cyan color attribute</short>
|
||||
</element>
|
||||
|
||||
<element name="LightRed">
|
||||
<short>Light red color attribute</short>
|
||||
</element>
|
||||
|
||||
<element name="LightMagenta">
|
||||
<short>Light magenta color attribute</short>
|
||||
</element>
|
||||
|
||||
<element name="Yellow">
|
||||
<short>Yellow color attribute</short>
|
||||
</element>
|
||||
|
||||
<element name="White">
|
||||
<short>White color attribute</short>
|
||||
</element>
|
||||
|
||||
<element name="Blink">
|
||||
<short>Blink attribute</short>
|
||||
</element>
|
||||
|
||||
<element name="TextAttr">
|
||||
<short>Mask to filter text attribute</short>
|
||||
<descr>
|
||||
The <var>TextAttr</var> variable controls the attributes with which characters
|
||||
are written to screen.
|
||||
</descr>
|
||||
</element>
|
||||
|
||||
<element name="TextChar">
|
||||
<short>Text character used when filling</short>
|
||||
</element>
|
||||
|
||||
<element name="CheckBreak">
|
||||
<short>Check for CTRL-Break keystroke. Not used.</short>
|
||||
</element>
|
||||
|
||||
<element name="CheckEOF">
|
||||
<short>Check for EOF on standard input. Not used.</short>
|
||||
</element>
|
||||
|
||||
<element name="CheckSnow">
|
||||
<short>Check snow on CGA screens. Not used.</short>
|
||||
</element>
|
||||
|
||||
<element name="DirectVideo">
|
||||
<short>Use direct video access. DOS only</short>
|
||||
<descr>
|
||||
The <var>DirectVideo</var> variable controls the writing to the screen. If it is
|
||||
<var>True</var>, the the cursor is set via direct port access. If <var>False</var>,
|
||||
then the BIOS is used. This is defined under dos only.
|
||||
</descr>
|
||||
</element>
|
||||
|
||||
<element name="LastMode">
|
||||
<short>Last screen mode.</short>
|
||||
<descr>
|
||||
The <var>Lastmode</var> variable tells you which mode was last selected for the
|
||||
screen. It is defined on DOS only.
|
||||
</descr>
|
||||
</element>
|
||||
|
||||
<element name="WindMin">
|
||||
<short>Minimum window dimension</short>
|
||||
</element>
|
||||
|
||||
<element name="WindMax">
|
||||
<short>Maximum window dimension</short>
|
||||
</element>
|
||||
|
||||
<element name="WindMaxX">
|
||||
<short>Maximum window X size</short>
|
||||
</element>
|
||||
|
||||
<element name="WindMaxY">
|
||||
<short>Maximum window Y size</short>
|
||||
</element>
|
||||
|
||||
<element name="WindMinX">
|
||||
<short>Minimum window X size</short>
|
||||
</element>
|
||||
|
||||
<element name="WindMinY">
|
||||
<short>Minimum window Y size</short>
|
||||
</element>
|
||||
|
||||
<element name="ScreenWidth">
|
||||
<short>Current screen width</short>
|
||||
</element>
|
||||
|
||||
<element name="ScreenHeight">
|
||||
<short>Current screen height.</short>
|
||||
</element>
|
||||
|
||||
<element name="bw40">
|
||||
<short>40 columns black and white screen mode.</short>
|
||||
</element>
|
||||
|
||||
<element name="co40">
|
||||
<short>40 columns color screen mode.</short>
|
||||
</element>
|
||||
|
||||
<element name="c40">
|
||||
<short>40 columns color screen mode.</short>
|
||||
</element>
|
||||
|
||||
<element name="bw80">
|
||||
<short>80 columns black and white screen mode.</short>
|
||||
</element>
|
||||
|
||||
<element name="co80">
|
||||
<short>80 columns color screen mode.</short>
|
||||
</element>
|
||||
|
||||
<element name="c80">
|
||||
<short>80 columns color screen mode.</short>
|
||||
</element>
|
||||
|
||||
<element name="mono">
|
||||
<short>Monochrome screen mode (hercules screens)</short>
|
||||
</element>
|
||||
|
||||
<element name="Font8x8">
|
||||
<short>Internal ROM font mode</short>
|
||||
</element>
|
||||
|
||||
<element name="ConsoleMaxX" skip="1"/>
|
||||
<element name="ConsoleMaxY" skip="1"/>
|
||||
<element name="Flushing" skip="1"/>
|
||||
<element name="PConsoleBuf" skip="1"/>
|
||||
<element name="TCharAttr" skip="1"/>
|
||||
<element name="TConsoleBuf" skip="1"/>
|
||||
<element name="ConsoleBuf" skip="1"/>
|
||||
|
||||
|
||||
<element name="AssignCrt">
|
||||
<short>Assign file to CRT.</short>
|
||||
<descr>
|
||||
<var>AssignCrt</var> Assigns a file <var>F</var> to the console. Everything written to
|
||||
the file <var>F</var> goes to the console instead. If the console contains a window,
|
||||
everything is written to the window instead.
|
||||
</descr>
|
||||
<errors>
|
||||
None.
|
||||
</errors>
|
||||
<seealso>
|
||||
<link id="Window"/>
|
||||
</seealso>
|
||||
<example file="crtex/ex1"/>
|
||||
</element>
|
||||
|
||||
|
||||
<element name="CursorBig">
|
||||
<short>Show big cursor</short>
|
||||
<descr>
|
||||
<var>CursorBig</var> makes the cursor a big rectangle.
|
||||
Not implemented on unixes.
|
||||
</descr>
|
||||
<errors>
|
||||
None.
|
||||
</errors>
|
||||
<seealso>
|
||||
<link id="CursorOn"/>
|
||||
<link id="CursorOff"/>
|
||||
</seealso>
|
||||
</element>
|
||||
|
||||
<element name="ClrEol">
|
||||
<short>Clear from cursor position till end of line.</short>
|
||||
<descr>
|
||||
<var>ClrEol</var> clears the current line, starting from the cursor position, to the
|
||||
end of the window. The cursor doesn't move
|
||||
</descr>
|
||||
<errors>
|
||||
None.
|
||||
</errors>
|
||||
<seealso>
|
||||
<link id="DelLine"/>
|
||||
<link id="InsLine"/>
|
||||
<link id="ClrScr"/>
|
||||
</seealso>
|
||||
<example file="crtex/ex9"/>
|
||||
</element>
|
||||
|
||||
|
||||
<element name="ClrScr">
|
||||
<short>Clear current window.</short>
|
||||
<descr>
|
||||
<var>ClrScr</var> clears the current window (using the current colors),
|
||||
and sets the cursor in the top left
|
||||
corner of the current window.
|
||||
</descr>
|
||||
<errors>
|
||||
None.
|
||||
</errors>
|
||||
<seealso>
|
||||
<link id="Window"/>
|
||||
</seealso>
|
||||
<example file="crtex/ex8"/>
|
||||
</element>
|
||||
|
||||
|
||||
<element name="CursorOff">
|
||||
<short>Hide cursor</short>
|
||||
<descr>
|
||||
<var>CursorOff</var> switches the cursor off (i.e. the cursor is no
|
||||
longer visible). Not implemented on unixes.
|
||||
</descr>
|
||||
<errors>
|
||||
None.
|
||||
</errors>
|
||||
<seealso>
|
||||
<link id="CursorOn"/>
|
||||
<link id="CursorBig"/>
|
||||
</seealso>
|
||||
</element>
|
||||
|
||||
<element name="CursorOn">
|
||||
<short>Display cursor</short>
|
||||
<descr>
|
||||
<var>CursorOn</var> switches the cursor on. Not implemented on unixes.
|
||||
</descr>
|
||||
<errors>
|
||||
None.
|
||||
</errors>
|
||||
<seealso>
|
||||
<link id="CursorBig"/>
|
||||
<link id="CursorOff"/>
|
||||
</seealso>
|
||||
</element>
|
||||
|
||||
<element name="Delay">
|
||||
<short>Delay program execution.</short>
|
||||
<descr>
|
||||
<var>Delay</var> waits a specified number of milliseconds. The number of specified
|
||||
seconds is an approximation, and may be off a lot, if system load is high.
|
||||
</descr>
|
||||
<errors>
|
||||
None
|
||||
</errors>
|
||||
<seealso>
|
||||
<link id="Sound"/>
|
||||
<link id="NoSound"/>
|
||||
</seealso>
|
||||
<example file="crtex/ex15"/>
|
||||
</element>
|
||||
|
||||
|
||||
<element name="DelLine">
|
||||
<short>Delete line at cursor position.</short>
|
||||
<descr>
|
||||
<var>DelLine</var> removes the current line. Lines following the current line are
|
||||
scrolled 1 line up, and an empty line is inserted at the bottom of the
|
||||
current window. The cursor doesn't move.
|
||||
</descr>
|
||||
<errors>
|
||||
None.
|
||||
</errors>
|
||||
<seealso>
|
||||
<link id="ClrEol"/>
|
||||
<link id="InsLine"/>
|
||||
<link id="ClrScr"/>
|
||||
</seealso>
|
||||
<example file="crtex/ex11"/>
|
||||
</element>
|
||||
|
||||
|
||||
<element name="GotoXY">
|
||||
<short>Set cursor position on screen.</short>
|
||||
<descr>
|
||||
<var>GotoXY</var> positions the cursor at <var>(X,Y)</var>, <var>X</var> in horizontal, <var>Y</var> in
|
||||
vertical direction relative to the origin of the current window. The origin
|
||||
is located at <var>(1,1)</var>, the upper-left corner of the window.
|
||||
</descr>
|
||||
<errors>
|
||||
None.
|
||||
</errors>
|
||||
<seealso>
|
||||
<link id="WhereX"/>
|
||||
<link id="WhereY"/>
|
||||
<link id="Window"/>
|
||||
</seealso>
|
||||
<example file="crtex/ex6"/>
|
||||
</element>
|
||||
|
||||
|
||||
<element name="HighVideo">
|
||||
<short>Switch to highlighted text mode</short>
|
||||
<descr>
|
||||
<var>HighVideo</var> switches the output to highlighted text. (It sets the high
|
||||
intensity bit of the video attribute)
|
||||
</descr>
|
||||
<errors>
|
||||
None.
|
||||
</errors>
|
||||
<seealso>
|
||||
<link id="TextColor"/>
|
||||
<link id="TextBackground"/>
|
||||
<link id="LowVideo"/>
|
||||
<link id="NormVideo"/>
|
||||
</seealso>
|
||||
<example file="crtex/ex14"/>
|
||||
</element>
|
||||
|
||||
|
||||
<element name="InsLine">
|
||||
<short>Insert an empty line at cursor position</short>
|
||||
<descr>
|
||||
<var>InsLine</var> inserts an empty line at the current cursor position.
|
||||
Lines following the current line are scrolled 1 line down,
|
||||
causing the last line to disappear from the window.
|
||||
The cursor doesn't move.
|
||||
</descr>
|
||||
<errors>
|
||||
None.
|
||||
</errors>
|
||||
<seealso>
|
||||
<link id="ClrEol"/>
|
||||
<link id="DelLine"/>
|
||||
<link id="ClrScr"/>
|
||||
</seealso>
|
||||
<example file="crtex/ex10"/>
|
||||
</element>
|
||||
|
||||
|
||||
<element name="KeyPressed">
|
||||
<short>Check if there is a keypress in the keybuffer</short>
|
||||
<descr>
|
||||
<var>Keypressed</var> scans the keyboard buffer and sees if a key has
|
||||
been pressed. If this is the case, <var>True</var> is returned. If not,
|
||||
<var>False</var> is returned. The <var>Shift, Alt, Ctrl</var> keys are not reported.
|
||||
The key is not removed from the buffer, and can hence still be read after
|
||||
the <var>KeyPressed</var> function has been called.
|
||||
</descr>
|
||||
<errors>
|
||||
None.
|
||||
</errors>
|
||||
<seealso>
|
||||
<link id="ReadKey"/>
|
||||
</seealso>
|
||||
<example file="crtex/ex2"/>
|
||||
</element>
|
||||
|
||||
|
||||
<element name="LowVideo">
|
||||
<short>Switch to low intensity colors.</short>
|
||||
<descr>
|
||||
<p>
|
||||
<var>LowVideo</var> switches the output to non-highlighted text. (It clears the high
|
||||
intensity bit of the video attribute)
|
||||
</p>
|
||||
<p>
|
||||
For an example, see <link id="HighVideo"/>
|
||||
</p>
|
||||
</descr>
|
||||
<errors>
|
||||
None.
|
||||
</errors>
|
||||
<seealso>
|
||||
<link id="TextColor"/>
|
||||
<link id="TextBackground"/>
|
||||
<link id="HighVideo"/>
|
||||
<link id="NormVideo"/>
|
||||
</seealso>
|
||||
</element>
|
||||
|
||||
<element name="NormVideo">
|
||||
<short>Return to normal (startup) modus</short>
|
||||
<descr>
|
||||
<p>
|
||||
<var>NormVideo</var> switches the output to the defaults, read at startup. (The
|
||||
defaults are read from the cursor position at startup)
|
||||
</p>
|
||||
<p>
|
||||
For an example, see <link id="HighVideo"/>
|
||||
</p>
|
||||
</descr>
|
||||
<errors>
|
||||
None.
|
||||
</errors>
|
||||
<seealso>
|
||||
<link id="TextColor"/>
|
||||
<link id="TextBackground"/>
|
||||
<link id="LowVideo"/>
|
||||
<link id="HighVideo"/>
|
||||
</seealso>
|
||||
</element>
|
||||
|
||||
<element name="NoSound">
|
||||
<short>Stop system speaker</short>
|
||||
<descr>
|
||||
<var>NoSound</var> stops the speaker sound.
|
||||
This call is not supported on all operating systems.
|
||||
</descr>
|
||||
<errors>
|
||||
None.
|
||||
</errors>
|
||||
<seealso>
|
||||
<link id="Sound"/>
|
||||
</seealso>
|
||||
<example file="crtex/ex16"/>
|
||||
</element>
|
||||
|
||||
<element name="ReadKey">
|
||||
<short>Read key from keybuffer</short>
|
||||
<descr>
|
||||
<p>
|
||||
<var>ReadKey</var> reads 1 key from the keyboard buffer, and returns this.
|
||||
If an extended or function key has been pressed, then the zero ASCII code is
|
||||
returned. You can then read the scan code of the key with a second ReadKey
|
||||
call.
|
||||
</p>
|
||||
<p>
|
||||
Key mappings under Linux can cause the wrong key to be
|
||||
reported by <var>ReadKey</var>, so caution is needed when using
|
||||
<var>ReadKey</var>.
|
||||
</p>
|
||||
</descr>
|
||||
<errors>
|
||||
None.
|
||||
</errors>
|
||||
<seealso>
|
||||
<link id="KeyPressed"/>
|
||||
</seealso>
|
||||
<example file="crtex/ex3"/>
|
||||
</element>
|
||||
|
||||
|
||||
<element name="Sound">
|
||||
<short>Sound system speaker</short>
|
||||
<descr>
|
||||
<var>Sound</var> sounds the speaker at a frequency of <var>hz</var>. Under Windows,
|
||||
a system sound is played and the frequency parameter is ignored.
|
||||
On other operating systems, this routine may not be implemented.
|
||||
</descr>
|
||||
<errors>
|
||||
None.
|
||||
</errors>
|
||||
<seealso>
|
||||
<link id="NoSound"/>
|
||||
</seealso>
|
||||
</element>
|
||||
|
||||
<element name="TextBackground">
|
||||
<short>Set text background</short>
|
||||
<descr>
|
||||
<var>TextBackground</var> sets the background color to <var>CL</var>. <var>CL</var> can be one of the
|
||||
predefined color constants.
|
||||
</descr>
|
||||
<errors>
|
||||
None.
|
||||
</errors>
|
||||
<seealso>
|
||||
<link id="TextColor"/>
|
||||
<link id="HighVideo"/>
|
||||
<link id="LowVideo"/>
|
||||
<link id="NormVideo"/>
|
||||
</seealso>
|
||||
<example file="crtex/ex13"/>
|
||||
</element>
|
||||
|
||||
|
||||
<element name="TextColor">
|
||||
<short>Set text color</short>
|
||||
<descr>
|
||||
<var>TextColor</var> sets the foreground color to <var>CL</var>. <var>CL</var> can be one of the
|
||||
predefined color constants.
|
||||
</descr>
|
||||
<errors>
|
||||
None.
|
||||
</errors>
|
||||
<seealso>
|
||||
<link id="TextBackground"/>
|
||||
<link id="HighVideo"/>
|
||||
<link id="LowVideo"/>
|
||||
<link id="NormVideo"/>
|
||||
</seealso>
|
||||
<example file="crtex/ex12"/>
|
||||
</element>
|
||||
|
||||
<element name="TextMode">
|
||||
<short>Set screen mode.</short>
|
||||
<descr>
|
||||
<p>
|
||||
<var>TextMode</var> sets the textmode of the screen (i.e. the number of lines
|
||||
and columns of the screen). The lower byte is use to set the VGA text mode.
|
||||
</p>
|
||||
<p>
|
||||
This procedure is only implemented on dos.
|
||||
</p>
|
||||
</descr>
|
||||
<errors>
|
||||
None.
|
||||
</errors>
|
||||
<seealso>
|
||||
<link id="Window"/>
|
||||
</seealso>
|
||||
</element>
|
||||
|
||||
<element name="WhereX">
|
||||
<short>Return X (horizontal) cursor position</short>
|
||||
<descr>
|
||||
<var>WhereX</var> returns the current X-coordinate of the cursor, relative to the
|
||||
current window. The origin is <var>(1,1)</var>, in the upper-left corner of the
|
||||
window.
|
||||
</descr>
|
||||
<errors>
|
||||
None.
|
||||
</errors>
|
||||
<seealso>
|
||||
<link id="GotoXY"/>
|
||||
<link id="WhereY"/>
|
||||
<link id="Window"/>
|
||||
</seealso>
|
||||
<example file="crtex/ex7"/>
|
||||
</element>
|
||||
|
||||
<element name="WhereY">
|
||||
<short>Return Y (vertical) cursor position</short>
|
||||
<descr>
|
||||
<var>WhereY</var> returns the current Y-coordinate of the cursor, relative to the
|
||||
current window. The origin is <var>(1,1)</var>, in the upper-left corner of the
|
||||
window.
|
||||
|
||||
</descr>
|
||||
<errors>
|
||||
None.
|
||||
</errors>
|
||||
<seealso>
|
||||
<link id="GotoXY"/>
|
||||
<link id="WhereX"/>
|
||||
<link id="Window"/>
|
||||
</seealso>
|
||||
<example file="crtex/ex7"/>
|
||||
</element>
|
||||
|
||||
|
||||
<element name="Window">
|
||||
<short>Create new window on screen.</short>
|
||||
<descr>
|
||||
<var>Window</var> creates a window on the screen, to which output will be sent.
|
||||
<var>(X1,Y1)</var> are the coordinates of the upper left corner of the window,
|
||||
<var>(X2,Y2)</var> are the coordinates of the bottom right corner of the window.
|
||||
These coordinates are relative to the entire screen, with the top left
|
||||
corner equal to <var>(1,1)</var>.
|
||||
Further coordinate operations, except for the next Window call,
|
||||
are relative to the window's top left corner.
|
||||
</descr>
|
||||
<errors>
|
||||
None.
|
||||
</errors>
|
||||
<seealso>
|
||||
<link id="GotoXY"/>
|
||||
<link id="WhereX"/>
|
||||
<link id="WhereY"/>
|
||||
<link id="ClrScr"/>
|
||||
</seealso>
|
||||
<example file="crtex/ex5"/>
|
||||
</element>
|
||||
|
||||
</module>
|
||||
</package>
|
||||
</fpdoc-descriptions>
|
1418
docs/dos.xml
Normal file
1418
docs/dos.xml
Normal file
File diff suppressed because it is too large
Load Diff
1060
docs/keyboard.xml
Normal file
1060
docs/keyboard.xml
Normal file
File diff suppressed because it is too large
Load Diff
527
docs/mouse.xml
Normal file
527
docs/mouse.xml
Normal file
@ -0,0 +1,527 @@
|
||||
<?xml version="1.0" encoding="ISO8859-1"?>
|
||||
<fpdoc-descriptions>
|
||||
<!--
|
||||
|
||||
$Id$
|
||||
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>
|
||||
|
||||
<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 returnead.
|
||||
</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 venet 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>
|
3264
docs/objects.xml
Normal file
3264
docs/objects.xml
Normal file
File diff suppressed because it is too large
Load Diff
1453
docs/sockets.xml
Normal file
1453
docs/sockets.xml
Normal file
File diff suppressed because it is too large
Load Diff
1001
docs/video.xml
Normal file
1001
docs/video.xml
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user