You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tqt3/doc/html/qtabletevent.html

252 lines
13 KiB

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/kernel/tqevent.cpp:1900 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>TQTabletEvent Class</title>
<style type="text/css"><!--
fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
body { background: #ffffff; color: black; }
--></style>
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr bgcolor="#E5E5E5">
<td valign=center>
<a href="index.html">
<font color="#004faf">Home</font></a>
| <a href="classes.html">
<font color="#004faf">All&nbsp;Classes</font></a>
| <a href="mainclasses.html">
<font color="#004faf">Main&nbsp;Classes</font></a>
| <a href="annotated.html">
<font color="#004faf">Annotated</font></a>
| <a href="groups.html">
<font color="#004faf">Grouped&nbsp;Classes</font></a>
| <a href="functions.html">
<font color="#004faf">Functions</font></a>
</td>
<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>TQTabletEvent Class Reference</h1>
<p>The TQTabletEvent class contains parameters that describe a Tablet
event.
<a href="#details">More...</a>
<p><tt>#include &lt;<a href="tqevent-h.html">tqevent.h</a>&gt;</tt>
<p>Inherits <a href="tqevent.html">TQEvent</a>.
<p><a href="qtabletevent-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li class=fn>enum <a href="#TabletDevice-enum"><b>TabletDevice</b></a> { NoDevice = -1, Puck, Stylus, Eraser }</li>
<li class=fn><a href="#TQTabletEvent"><b>TQTabletEvent</b></a> ( Type&nbsp;t, const&nbsp;TQPoint&nbsp;&amp;&nbsp;pos, const&nbsp;TQPoint&nbsp;&amp;&nbsp;globalPos, int&nbsp;device, int&nbsp;pressure, int&nbsp;xTilt, int&nbsp;yTilt, const&nbsp;TQPair&lt;int,&nbsp;int&gt;&nbsp;&amp;&nbsp;uId )</li>
<li class=fn>TQTabletEvent ( const&nbsp;TQPoint&nbsp;&amp;&nbsp;pos, const&nbsp;TQPoint&nbsp;&amp;&nbsp;globalPos, int&nbsp;device, int&nbsp;pressure, int&nbsp;xTilt, int&nbsp;yTilt, const&nbsp;TQPair&lt;int,&nbsp;int&gt;&nbsp;&amp;&nbsp;uId ) &nbsp;<em>(obsolete)</em></li>
<li class=fn>int <a href="#pressure"><b>pressure</b></a> () const</li>
<li class=fn>int <a href="#xTilt"><b>xTilt</b></a> () const</li>
<li class=fn>int <a href="#yTilt"><b>yTilt</b></a> () const</li>
<li class=fn>const TQPoint &amp; <a href="#pos"><b>pos</b></a> () const</li>
<li class=fn>const TQPoint &amp; <a href="#globalPos"><b>globalPos</b></a> () const</li>
<li class=fn>int <a href="#x"><b>x</b></a> () const</li>
<li class=fn>int <a href="#y"><b>y</b></a> () const</li>
<li class=fn>int <a href="#globalX"><b>globalX</b></a> () const</li>
<li class=fn>int <a href="#globalY"><b>globalY</b></a> () const</li>
<li class=fn>TabletDevice <a href="#device"><b>device</b></a> () const</li>
<li class=fn>int <a href="#isAccepted"><b>isAccepted</b></a> () const</li>
<li class=fn>void <a href="#accept"><b>accept</b></a> ()</li>
<li class=fn>void <a href="#ignore"><b>ignore</b></a> ()</li>
<li class=fn>TQPair&lt;int, int&gt; <a href="#uniqueId"><b>uniqueId</b></a> ()</li>
</ul>
<hr><a name="details"></a><h2>Detailed Description</h2>
The TQTabletEvent class contains parameters that describe a Tablet
event.
<p>
<p> Tablet Events are generated from a Wacom&copy; tablet. Most of
the time you will want to deal with events from the tablet as if
they were events from a mouse, for example retrieving the position
with <a href="#x">x</a>(), <a href="#y">y</a>(), <a href="#pos">pos</a>(), <a href="#globalX">globalX</a>(), <a href="#globalY">globalY</a>() and <a href="#globalPos">globalPos</a>(). In
some situations you may wish to retrieve the extra information
provided by the tablet device driver, for example, you might want
to adjust color brightness based on pressure. TQTabletEvent allows
you to get the <a href="#pressure">pressure</a>(), the <a href="#xTilt">xTilt</a>() and <a href="#yTilt">yTilt</a>(), as well as the
type of device being used with <a href="#device">device</a>() (see <a href="#TabletDevice-enum">TabletDevice</a>).
<p> A tablet event contains a special accept flag that indicates
whether the receiver wants the event. You should call
<a href="#accept">TQTabletEvent::accept</a>() if you handle the tablet event; otherwise
it will be sent to the parent widget.
<p> The <a href="tqwidget.html#setEnabled">TQWidget::setEnabled</a>() function can be used to enable or
disable mouse and keyboard events for a widget.
<p> The event handler <a href="tqwidget.html#tabletEvent">TQWidget::tabletEvent</a>() receives all three types of tablet
events. TQt will first send a tabletEvent and then, if it is not accepted,
it will send a mouse event. This allows applications that don't utilize
tablets to use a tablet like a mouse while also enabling those who want to
use both tablets and mouses differently.
<p> <p>See also <a href="events.html">Event Classes</a>.
<hr><h2>Member Type Documentation</h2>
<h3 class=fn><a name="TabletDevice-enum"></a>TQTabletEvent::TabletDevice</h3>
<p> This enum defines what type of device is generating the event.
<ul>
<li><tt>TQTabletEvent::NoDevice</tt> - No device, or an unknown device.
<li><tt>TQTabletEvent::Puck</tt> - A Puck (a device that is similar to a flat mouse with
a transparent circle with cross-hairs).
<li><tt>TQTabletEvent::Stylus</tt> - A Stylus (the narrow end of the pen).
<li><tt>TQTabletEvent::Eraser</tt> - An Eraser (the broad end of the pen).
</ul>
<hr><h2>Member Function Documentation</h2>
<h3 class=fn><a name="TQTabletEvent"></a>TQTabletEvent::TQTabletEvent ( <a href="tqevent.html#Type-enum">Type</a>&nbsp;t, const&nbsp;<a href="tqpoint.html">TQPoint</a>&nbsp;&amp;&nbsp;pos, const&nbsp;<a href="tqpoint.html">TQPoint</a>&nbsp;&amp;&nbsp;globalPos, int&nbsp;device, int&nbsp;pressure, int&nbsp;xTilt, int&nbsp;yTilt, const&nbsp;<a href="tqpair.html">TQPair</a>&lt;int,&nbsp;int&gt;&nbsp;&amp;&nbsp;uId )
</h3>
Construct a tablet event of type <em>t</em>. The position of when the event occurred is given
int <em>pos</em> and <em>globalPos</em>. <em>device</em> contains the <a href="#TabletDevice-enum">device type</a>,
<em>pressure</em> contains the pressure exerted on the <em>device</em>, <em>xTilt</em> and <em>yTilt</em> contain
<em>device</em>'s degree of tilt from the X and Y axis respectively. The <em>uId</em> contains an
event id.
<p> On Irix, <em>globalPos</em> will contain the high-resolution coordinates received from the
tablet device driver, instead of from the windowing system.
<p> <p>See also <a href="#pos">pos</a>(), <a href="#globalPos">globalPos</a>(), <a href="#device">device</a>(), <a href="#pressure">pressure</a>(), <a href="#xTilt">xTilt</a>(), and <a href="#yTilt">yTilt</a>().
<h3 class=fn><a name="TQTabletEvent-2"></a>TQTabletEvent::TQTabletEvent ( const&nbsp;<a href="tqpoint.html">TQPoint</a>&nbsp;&amp;&nbsp;pos, const&nbsp;<a href="tqpoint.html">TQPoint</a>&nbsp;&amp;&nbsp;globalPos, int&nbsp;device, int&nbsp;pressure, int&nbsp;xTilt, int&nbsp;yTilt, const&nbsp;<a href="tqpair.html">TQPair</a>&lt;int,&nbsp;int&gt;&nbsp;&amp;&nbsp;uId )
</h3>
<b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
<p>
<p> Constructs a tablet event object. The position when the event
occurred is is given in <em>pos</em> and <em>globalPos</em>. <em>device</em>
contains the <a href="#TabletDevice-enum">device type</a>, <em>pressure</em>
contains the pressure exerted on the <em>device</em>, <em>xTilt</em> and <em>yTilt</em> contain the <em>device</em>'s degrees of tilt from the X and Y
axis respectively. The <em>uId</em> contains an event id.
<p> On Irix, <em>globalPos</em> will contain the high-resolution coordinates
received from the tablet device driver, instead of from the
windowing system.
<p> <p>See also <a href="#pos">pos</a>(), <a href="#globalPos">globalPos</a>(), <a href="#device">device</a>(), <a href="#pressure">pressure</a>(), <a href="#xTilt">xTilt</a>(), and <a href="#yTilt">yTilt</a>().
<h3 class=fn>void <a name="accept"></a>TQTabletEvent::accept ()
</h3>
<p> Sets the accept flag of the tablet event object.
<p> Setting the accept flag indicates that the receiver of the event
wants the tablet event. Unwanted tablet events are sent to the
parent widget.
<p> The accept flag is set by default.
<p> <p>See also <a href="#ignore">ignore</a>().
<h3 class=fn><a href="qtabletevent.html#TabletDevice-enum">TabletDevice</a> <a name="device"></a>TQTabletEvent::device () const
</h3>
<p> Returns the type of device that generated the event. Useful if you
want one end of the pen to do something different than the other.
<p> <p>See also <a href="#TabletDevice-enum">TabletDevice</a>.
<h3 class=fn>const&nbsp;<a href="tqpoint.html">TQPoint</a>&nbsp;&amp; <a name="globalPos"></a>TQTabletEvent::globalPos () const
</h3>
<p> Returns the global position of the device <em>at the time of the event</em>. This is important on asynchronous windows systems like X11;
whenever you move your widgets around in response to mouse events,
<a href="#globalPos">globalPos</a>() can differ significantly from the current position
<a href="ntqcursor.html#pos">TQCursor::pos</a>().
<p> <p>See also <a href="#globalX">globalX</a>() and <a href="#globalY">globalY</a>().
<h3 class=fn>int <a name="globalX"></a>TQTabletEvent::globalX () const
</h3>
<p> Returns the global x-position of the mouse pointer at the time of
the event.
<p> <p>See also <a href="#globalY">globalY</a>() and <a href="#globalPos">globalPos</a>().
<h3 class=fn>int <a name="globalY"></a>TQTabletEvent::globalY () const
</h3>
<p> Returns the global y-position of the mouse pointer at the time of
the event.
<p> <p>See also <a href="#globalX">globalX</a>() and <a href="#globalPos">globalPos</a>().
<h3 class=fn>void <a name="ignore"></a>TQTabletEvent::ignore ()
</h3>
<p> Clears the accept flag parameter of the tablet event object.
<p> Clearing the accept flag indicates that the event receiver does
not want the tablet event. Unwanted tablet events are sent to the
parent widget.
<p> The accept flag is set by default.
<p> <p>See also <a href="#accept">accept</a>().
<h3 class=fn>int <a name="isAccepted"></a>TQTabletEvent::isAccepted () const
</h3>
<p> Returns TRUE if the receiver of the event handles the tablet
event; otherwise returns FALSE.
<h3 class=fn>const&nbsp;<a href="tqpoint.html">TQPoint</a>&nbsp;&amp; <a name="pos"></a>TQTabletEvent::pos () const
</h3>
<p> Returns the position of the device, relative to the widget that
received the event.
<p> If you move widgets around in response to mouse events, use
<a href="#globalPos">globalPos</a>() instead of this function.
<p> <p>See also <a href="#x">x</a>(), <a href="#y">y</a>(), and <a href="#globalPos">globalPos</a>().
<h3 class=fn>int <a name="pressure"></a>TQTabletEvent::pressure () const
</h3>
<p> Returns the pressure that is exerted on the device. This number is
a value from 0 (no pressure) to 255 (maximum pressure). The
pressure is always scaled to be within this range no matter how
many pressure levels the underlying hardware supports.
<h3 class=fn><a href="tqpair.html">TQPair</a>&lt;int,&nbsp;int&gt; <a name="uniqueId"></a>TQTabletEvent::uniqueId ()
</h3>
<p> Returns a unique ID for the current device. It is possible to
generate a unique ID for any Wacom&copy; device. This makes it
possible to differentiate between multiple devices being used at
the same time on the tablet. The <tt>first</tt> member contains a value
for the type, the <tt>second</tt> member contains a physical ID obtained
from the device. Each combination of these values is unique. Note:
for different platforms, the <tt>first</tt> value is different due to
different driver implementations.
<h3 class=fn>int <a name="x"></a>TQTabletEvent::x () const
</h3>
<p> Returns the x-position of the device, relative to the widget that
received the event.
<p> <p>See also <a href="#y">y</a>() and <a href="#pos">pos</a>().
<h3 class=fn>int <a name="xTilt"></a>TQTabletEvent::xTilt () const
</h3>
<p> Returns the difference from the perpendicular in the X Axis.
Positive values are towards the tablet's physical right. The angle
is in the range -60 to +60 degrees.
<p> <p>See also <a href="#yTilt">yTilt</a>().
<h3 class=fn>int <a name="y"></a>TQTabletEvent::y () const
</h3>
<p> Returns the y-position of the device, relative to the widget that
received the event.
<p> <p>See also <a href="#x">x</a>() and <a href="#pos">pos</a>().
<h3 class=fn>int <a name="yTilt"></a>TQTabletEvent::yTilt () const
</h3>
<p> Returns the difference from the perpendicular in the Y Axis.
Positive values are towards the bottom of the tablet. The angle is
within the range -60 to +60 degrees.
<p> <p>See also <a href="#xTilt">xTilt</a>().
<!-- eof -->
<hr><p>
This file is part of the <a href="index.html">TQt toolkit</a>.
Copyright &copy; 1995-2007
<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
<table width=100% cellspacing=0 border=0><tr>
<td>Copyright &copy; 2007
<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
<td align=right><div align=right>TQt 3.3.8</div>
</table></div></address></body>
</html>