46 #include <QSocketNotifier> 47 #include <QStringList> 49 #include <QWindowSystemInterface> 62 : m_notify(0), m_x(0), m_y(0), m_pressed(0), m_rawMode(false)
64 qDebug() <<
"QTsLibMouseHandler" << key << specification;
68 if (specification.startsWith(
"/dev/"))
69 device = specification.toLocal8Bit();
73 if (ts_config(
m_dev)) {
74 perror(
"Error configuring\n");
80 int fd = ts_fd(
m_dev);
98 static bool get_sample(
struct tsdev *dev,
struct ts_sample *sample,
bool rawMode)
101 return (ts_read_raw(dev, sample, 1) == 1);
103 int ret = ts_read(dev, sample, 1);
114 bool pressed = sample.pressure;
123 if (dx*dx <= 4 && dy*dy <= 4 && pressed ==
m_pressed)
127 if (sample.pressure == 0 && sample.x == 0 && sample.y == 0) {
#define QT_END_NAMESPACE
This macro expands to.
The QByteArray class provides an array of bytes.
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
QTsLibMouseHandler(const QString &key, const QString &specification)
The QString class provides a Unicode character string.
The QSocketNotifier class provides support for monitoring activity on a file descriptor.
void setObjectName(const QString &name)
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...
static void handleMouseEvent(QWidget *w, const QPoint &local, const QPoint &global, Qt::MouseButtons b)
tlw == 0 means that ev is in global coords only
Q_CORE_EXPORT void qWarning(const char *,...)
QSocketNotifier * m_notify
const char * constData() const
Returns a pointer to the data stored in the byte array.
int compare(const QString &s) const
The QPoint class defines a point in the plane using integer precision.
static bool get_sample(struct tsdev *dev, struct ts_sample *sample, bool rawMode)