43 #ifndef QT_NO_QWS_TRANSFORMED 47 #include "qplatformdefs.h" 49 #include "private/qcore_unix_p.h" 51 #include <sys/dcmd_input.h> 105 QT_OPEN_RDONLY | O_NONBLOCK);
109 struct _pointer_info data;
110 if (devctl(
mouseFD, _POINTERGETINFO, &data,
sizeof(data), NULL) == EOK)
120 qDebug(
"QQnxMouseHandler: connected.");
122 #ifndef QT_NO_QWS_TRANSFORMED 161 #ifndef QT_NO_QWS_TRANSFORMED 169 struct _mouse_packet buffer[32];
173 int bytesRead =
QT_READ(
mouseFD, reinterpret_cast<char *>(buffer) + n,
sizeof(buffer) - n);
174 if (bytesRead == -1) {
182 if (n %
sizeof(buffer[0]) == 0)
185 n /=
sizeof(buffer[0]);
187 for (
int i = 0; i < n; ++i) {
188 const struct _mouse_packet &packet = buffer[i];
192 queuedPos =
QPoint(packet.dx, packet.dy);
195 queuedPos +=
QPoint(packet.dx, -packet.dy);
204 if (packet.hdr.buttons & _POINTER_BUTTON_LEFT)
206 if (packet.hdr.buttons & _POINTER_BUTTON_MIDDLE)
208 if (packet.hdr.buttons & _POINTER_BUTTON_RIGHT)
215 #ifndef QT_NO_QWS_TRANSFORMED 224 #ifndef QT_NO_QWS_TRANSFORMED Q_GUI_EXPORT QScreen * qt_screen
QBool contains(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
QPoint transformedMousePos
#define QT_END_NAMESPACE
This macro expands to.
The QWSMouseHandler class is a base class for mouse drivers in Qt for Embedded Linux.
static Qt::MouseButtons buttons
~QQnxMouseHandler()
Destroys this mouse handler and closes the connection to the mouse device.
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
int deviceWidth() const
Returns the physical width of the framebuffer device in pixels.
The QString class provides a Unicode character string.
void mouseChanged(const QPoint &pos, int bstate, int wheel=0)
Notifies the system of a new mouse event.
The QObject class is the base class of all Qt objects.
void socketActivated()
This function is called whenever there is activity on the mouse device.
The QSocketNotifier class provides support for monitoring activity on a file descriptor.
Q_CORE_EXPORT void qDebug(const char *,...)
#define QT_BEGIN_NAMESPACE
This macro expands to.
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
void resume()
Reimplemented Function
QByteArray toLatin1() const Q_REQUIRED_RESULT
Returns a Latin-1 representation of the string as a QByteArray.
const char * constData() const
Returns a pointer to the data stored in the byte array.
QQnxMouseHandler(const QString &driver=QString(), const QString &device=QString())
Constructs a mouse handler for the specified device, defaulting to /dev/devi/mouse0.
QSocketNotifier * mouseNotifier
int deviceHeight() const
Returns the full height of the framebuffer device in pixels.
The QPoint class defines a point in the plane using integer precision.
void setEnabled(bool)
If enable is true, the notifier is enabled; otherwise the notifier is disabled.
void limitToScreen(QPoint &pt)
Ensures that the given position is within the screen's boundaries, changing the position if necessary...
void suspend()
Reimplemented Function
void qErrnoWarning(const char *msg,...)
#define forever
This macro is provided for convenience for writing infinite loops.