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
|
<!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 Classes</font></a>
| <a href="mainclasses.html">
<font color="#004faf">Main Classes</font></a>
| <a href="annotated.html">
<font color="#004faf">Annotated</font></a>
| <a href="groups.html">
<font color="#004faf">Grouped 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 <<a href="tqevent-h.html">tqevent.h</a>></tt>
<p>Inherits <a href="tqevent.html">TQEvent</a>.
<p><a href="tqtabletevent-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 t, const TQPoint & pos, const TQPoint & globalPos, int device, int pressure, int xTilt, int yTilt, const TQPair<int, int> & uId )</li>
<li class=fn>TQTabletEvent ( const TQPoint & pos, const TQPoint & globalPos, int device, int pressure, int xTilt, int yTilt, const TQPair<int, int> & uId ) <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 & <a href="#pos"><b>pos</b></a> () const</li>
<li class=fn>const TQPoint & <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<int, int> <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© 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> t, const <a href="tqpoint.html">TQPoint</a> & pos, const <a href="tqpoint.html">TQPoint</a> & globalPos, int device, int pressure, int xTilt, int yTilt, const <a href="tqpair.html">TQPair</a><int, int> & 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 <a href="tqpoint.html">TQPoint</a> & pos, const <a href="tqpoint.html">TQPoint</a> & globalPos, int device, int pressure, int xTilt, int yTilt, const <a href="tqpair.html">TQPair</a><int, int> & 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="tqtabletevent.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 <a href="tqpoint.html">TQPoint</a> & <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 <a href="tqpoint.html">TQPoint</a> & <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><int, int> <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© 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 © 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 © 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>
|