![]() |
Home · All Classes · Main Classes · Grouped Classes · Modules · Functions | ![]() |
The QWSCalibratedMouseHandler class provides basic functionality for implementing a mouse handler that needs calibration. More...
#include <QWSCalibratedMouseHandler>
Inherits QWSMouseHandler.
Inherited by QWSTslibMouseHandler.
The QWSCalibratedMouseHandler class provides basic functionality for implementing a mouse handler that needs calibration.
Derive from this class to create a handler when the device doesn't have a fixed mapping between device coordinates and/or produces noisy events. A touchscreen is a good example of such a device.
The QWSCalibratedMouseHandler provides linear transformation between device coordinates and screen coordinates by calling transform(). This implementation uses 7 parameters a, b, c, d, e, f, s to transform the device coordinates (Xd, Yd) into screen coordinates (Xs, Ys) using the following equations:
s*Xs = a*Xd + b*Yy + c s*Ys = d*Xd + e*Yd + f
The parameters are stored in /etc/pointercal (separated by whitespace and in alphabetical order), and are read when the class is instantiated. The calibration parameters are recalculated whenever calibrate() is called.
To achieve noise reduction, use the sendFiltered() function instead of mouseChanged() whenever a mouse event occurs.
Updates the calibration parameters based on coordinate mapping of the given data.
Reimplemented from QWSMouseHandler.
Clears the current calibration.
After this function is called the mouse handler will return mouse events in raw device coordinates and not in screen coordinates.
Reimplemented from QWSMouseHandler.
Reads previously written calibration parameters.
See also writeCalibration().
Notifies the system of a new mouse event after applying a noise reduction filter.
Returns true if mouseChanged() was called; otherwise returns false.
The given position is the global position of the mouse. The state parameter is a bitmask of Qt::MouseButtons indicating which mouse buttons are pressed.
See also mouseChanged().
Sets the size of the filter used in noise reduction to the given size.
See also sendFiltered().
Transforms the given position from device coordinates to screen coordinates, and returns the transformed position.
Save the current calibration parameters.
Copyright © 2006 Trolltech | Trademarks | Qt 4.1.1 |