Home · All Classes · Main Classes · Grouped Classes · Modules · Functions |
The QWSMouseHandler class implements a mouse driver in Qtopia Core. More...
#include <QWSMouseHandler>
Inherited by QWSCalibratedMouseHandler.
The QWSMouseHandler class implements a mouse driver in Qtopia Core.
A mouse driver handles events from system devices and generates mouse events. Custom mouse drivers can be added by subclassing the QMouseDriverPlugin class, using the QMouseDriverFactory class to dynamically load the driver into the application.
A QWSMouseHandler object will usually open some system device, and create a QSocketNotifier object for that device. The QSocketNotifier class provides support for monitoring activity on a file descriptor. When the socket notifier receives data, it will call the mouse handler's mouseChanged() function to send the event to the Qtopia Core server application for relaying to clients.
If you are creating a handler for a device that needs calibration or noise reduction, such as a touchscreen, use the QWSCalibratedMouseHandler subclass instead to take advantage of the calibrate() and clearCalibration() functions.
Note that when deriving from the QWSMouseHandler class, the resume() and suspend() functions must be reimplemented to control the flow of mouse input. The default implementation does nothing; reimplementations of these functions typically call the QSocketNotifier::setEnabled() function to enable or disable the socket notifier, respectively.
In addition, QWSMouseHandler provides the limitToScreen() function ensuring that the given position is within the screen's boundaries (changing the position if necessary), and the pos() function returning the current mouse position.
See also Pointer Handling, Mouse Calibration Example, and Qtopia Core.
Constructs a mouse handler which becomes the primary mouse handler.
Note that once created, mouse handlers are controlled by the system and should not be deleted. The driver and device arguments are passed by the QWS_MOUSE_PROTO environment variable.
Destroys this mouse handler.
Do not call this function directly; it should only be called when the application terminates and from within Qtopia Core.
This virtual function allows subclasses of QWSMouseHandler to set the calibration information passed in the given data. The default implementation does nothing.
See also QWSCalibratedMouseHandler::calibrate() and clearCalibration().
This virtual function allows subclasses of QWSMouseHandler to clear the calibration information. The default implementation does nothing.
See also QWSCalibratedMouseHandler::clearCalibration() and calibrate().
Ensures that the given position is within the screen's boundaries, changing the position if necessary.
See also pos().
Notifies the system of a new mouse event.
This function updates the current mouse position and sends the event to the Qtopia Core server application for delivery to the correct widget.
The given position is the global position of the mouse cursor. The state parameter is a bitmask of the Qt::MouseButton enum's values, indicating which mouse buttons are pressed. The wheel parameter is the delta value of the mouse wheel as returned by QWheelEvent::delta().
A subclass must call this function whenever it wants to deliver a new mouse event.
See also pos().
Returns the current mouse position.
See also mouseChanged() and limitToScreen().
Resumes reading and handling mouse events.
Note that this function must be reimplemented in subclasses to control the flow of mouse input. The default implementation does nothing; reimplementations typically call the QSocketNotifier::setEnabled() function to enable the socket notifier.
See also suspend().
Suspends reading and handling of mouse events.
Note that this function must be reimplemented in subclasses to control the flow of mouse input. The default implementation does nothing; reimplementations typically call the QSocketNotifier::setEnabled() function to disable the socket notifier.
See also resume().
Copyright © 2006 Trolltech | Trademarks | Qt 4.1.3 |