summaryrefslogtreecommitdiffstats
path: root/doc/man/man3/qtabletevent.3qt
blob: 9c1c7640c5f7867940ea8c870c8dc38eedf0aaca (plain)
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
'\" t
.TH QTabletEvent 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*-
.\" Copyright 1992-2007 Trolltech ASA.  All rights reserved.  See the
.\" license file included in the distribution for a complete license
.\" statement.
.\"
.ad l
.nh
.SH NAME
QTabletEvent \- Parameters that describe a Tablet event
.SH SYNOPSIS
\fC#include <qevent.h>\fR
.PP
Inherits QEvent.
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "enum \fBTabletDevice\fR { NoDevice = -1, Puck, Stylus, Eraser }"
.br
.ti -1c
.BI "\fBQTabletEvent\fR ( Type t, const QPoint & pos, const QPoint & globalPos, int device, int pressure, int xTilt, int yTilt, const QPair<int, int> & uId )"
.br
.ti -1c
.BI "QTabletEvent ( const QPoint & pos, const QPoint & globalPos, int device, int pressure, int xTilt, int yTilt, const QPair<int, int> & uId )  \fI(obsolete)\fR"
.br
.ti -1c
.BI "int \fBpressure\fR () const"
.br
.ti -1c
.BI "int \fBxTilt\fR () const"
.br
.ti -1c
.BI "int \fByTilt\fR () const"
.br
.ti -1c
.BI "const QPoint & \fBpos\fR () const"
.br
.ti -1c
.BI "const QPoint & \fBglobalPos\fR () const"
.br
.ti -1c
.BI "int \fBx\fR () const"
.br
.ti -1c
.BI "int \fBy\fR () const"
.br
.ti -1c
.BI "int \fBglobalX\fR () const"
.br
.ti -1c
.BI "int \fBglobalY\fR () const"
.br
.ti -1c
.BI "TabletDevice \fBdevice\fR () const"
.br
.ti -1c
.BI "int \fBisAccepted\fR () const"
.br
.ti -1c
.BI "void \fBaccept\fR ()"
.br
.ti -1c
.BI "void \fBignore\fR ()"
.br
.ti -1c
.BI "QPair<int, int> \fBuniqueId\fR ()"
.br
.in -1c
.SH DESCRIPTION
The QTabletEvent class contains parameters that describe a Tablet event.
.PP
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 x(), y(), pos(), globalX(), globalY() and globalPos(). 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. QTabletEvent allows you to get the pressure(), the xTilt() and yTilt(), as well as the type of device being used with device() (see TabletDevice).
.PP
A tablet event contains a special accept flag that indicates whether the receiver wants the event. You should call QTabletEvent::accept() if you handle the tablet event; otherwise it will be sent to the parent widget.
.PP
The QWidget::setEnabled() function can be used to enable or disable mouse and keyboard events for a widget.
.PP
The event handler QWidget::tabletEvent() receives all three types of tablet events. Qt 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.
.PP
See also Event Classes.
.SS "Member Type Documentation"
.SH "QTabletEvent::TabletDevice"
This enum defines what type of device is generating the event.
.TP
\fCQTabletEvent::NoDevice\fR - No device, or an unknown device.
.TP
\fCQTabletEvent::Puck\fR - A Puck (a device that is similar to a flat mouse with a transparent circle with cross-hairs).
.TP
\fCQTabletEvent::Stylus\fR - A Stylus (the narrow end of the pen).
.TP
\fCQTabletEvent::Eraser\fR - An Eraser (the broad end of the pen).
.SH MEMBER FUNCTION DOCUMENTATION
.SH "QTabletEvent::QTabletEvent ( Type t, const QPoint & pos, const QPoint & globalPos, int device, int pressure, int xTilt, int yTilt, const QPair<int, int> & uId )"
Construct a tablet event of type \fIt\fR. The position of when the event occurred is given int \fIpos\fR and \fIglobalPos\fR. \fIdevice\fR contains the device type, \fIpressure\fR contains the pressure exerted on the \fIdevice\fR, \fIxTilt\fR and \fIyTilt\fR contain \fIdevice\fR's degree of tilt from the X and Y axis respectively. The \fIuId\fR contains an event id.
.PP
On Irix, \fIglobalPos\fR will contain the high-resolution coordinates received from the tablet device driver, instead of from the windowing system.
.PP
See also pos(), globalPos(), device(), pressure(), xTilt(), and yTilt().
.SH "QTabletEvent::QTabletEvent ( const QPoint & pos, const QPoint & globalPos, int device, int pressure, int xTilt, int yTilt, const QPair<int, int> & uId )"
\fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code.
.PP
Constructs a tablet event object. The position when the event occurred is is given in \fIpos\fR and \fIglobalPos\fR. \fIdevice\fR contains the device type, \fIpressure\fR contains the pressure exerted on the \fIdevice\fR, \fIxTilt\fR and \fIyTilt\fR contain the \fIdevice\fR's degrees of tilt from the X and Y axis respectively. The \fIuId\fR contains an event id.
.PP
On Irix, \fIglobalPos\fR will contain the high-resolution coordinates received from the tablet device driver, instead of from the windowing system.
.PP
See also pos(), globalPos(), device(), pressure(), xTilt(), and yTilt().
.SH "void QTabletEvent::accept ()"
Sets the accept flag of the tablet event object.
.PP
Setting the accept flag indicates that the receiver of the event wants the tablet event. Unwanted tablet events are sent to the parent widget.
.PP
The accept flag is set by default.
.PP
See also ignore().
.SH "TabletDevice QTabletEvent::device () const"
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.
.PP
See also TabletDevice.
.SH "const QPoint & QTabletEvent::globalPos () const"
Returns the global position of the device \fIat the time of the event\fR. This is important on asynchronous windows systems like X11; whenever you move your widgets around in response to mouse events, globalPos() can differ significantly from the current position QCursor::pos().
.PP
See also globalX() and globalY().
.SH "int QTabletEvent::globalX () const"
Returns the global x-position of the mouse pointer at the time of the event.
.PP
See also globalY() and globalPos().
.SH "int QTabletEvent::globalY () const"
Returns the global y-position of the mouse pointer at the time of the event.
.PP
See also globalX() and globalPos().
.SH "void QTabletEvent::ignore ()"
Clears the accept flag parameter of the tablet event object.
.PP
Clearing the accept flag indicates that the event receiver does not want the tablet event. Unwanted tablet events are sent to the parent widget.
.PP
The accept flag is set by default.
.PP
See also accept().
.SH "int QTabletEvent::isAccepted () const"
Returns TRUE if the receiver of the event handles the tablet event; otherwise returns FALSE.
.SH "const QPoint & QTabletEvent::pos () const"
Returns the position of the device, relative to the widget that received the event.
.PP
If you move widgets around in response to mouse events, use globalPos() instead of this function.
.PP
See also x(), y(), and globalPos().
.SH "int QTabletEvent::pressure () const"
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.
.SH "QPair<int, int> QTabletEvent::uniqueId ()"
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 \fCfirst\fR member contains a value for the type, the \fCsecond\fR member contains a physical ID obtained from the device. Each combination of these values is unique. Note: for different platforms, the \fCfirst\fR value is different due to different driver implementations.
.SH "int QTabletEvent::x () const"
Returns the x-position of the device, relative to the widget that received the event.
.PP
See also y() and pos().
.SH "int QTabletEvent::xTilt () const"
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.
.PP
See also yTilt().
.SH "int QTabletEvent::y () const"
Returns the y-position of the device, relative to the widget that received the event.
.PP
See also x() and pos().
.SH "int QTabletEvent::yTilt () const"
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.
.PP
See also xTilt().

.SH "SEE ALSO"
.BR http://doc.trolltech.com/qtabletevent.html
.BR http://www.trolltech.com/faq/tech.html
.SH COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com.  See the
license file included in the distribution for a complete license
statement.
.SH AUTHOR
Generated automatically from the source code.
.SH BUGS
If you find a bug in Qt, please report it as described in
.BR http://doc.trolltech.com/bughowto.html .
Good bug reports help us to help you. Thank you.
.P
The definitive Qt documentation is provided in HTML format; it is
located at $QTDIR/doc/html and can be read using Qt Assistant or with
a web browser. This man page is provided as a convenience for those
users who prefer man pages, although this format is not officially
supported by Trolltech. 
.P
If you find errors in this manual page, please report them to
.BR qt-bugs@trolltech.com .
Please include the name of the manual page (qtabletevent.3qt) and the Qt
version (3.3.8).