From e6a4d6054d6c4c9c2d8796255659bb6b3fcca635 Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Fri, 25 May 2012 16:42:55 -0700 Subject: evdev: Cleanup mouse and keyboard plugins Remove fallback event0 device usage. All available devices should be detected automatically from DeviceDiscovery either through udev or the static fallback discovery method. This also removes the never used 'key' argument, which was pulled over from Qt4. Change-Id: Iffe8bd80f0770664024019a220cbbc6f98843340 Reviewed-by: Girish Ramakrishnan --- .../generic/evdevmouse/qevdevmousehandler.cpp | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'src/plugins/generic/evdevmouse/qevdevmousehandler.cpp') diff --git a/src/plugins/generic/evdevmouse/qevdevmousehandler.cpp b/src/plugins/generic/evdevmouse/qevdevmousehandler.cpp index 55392c20c4..439d2c095a 100644 --- a/src/plugins/generic/evdevmouse/qevdevmousehandler.cpp +++ b/src/plugins/generic/evdevmouse/qevdevmousehandler.cpp @@ -62,15 +62,12 @@ QT_BEGIN_NAMESPACE -QEvdevMouseHandler *QEvdevMouseHandler::createLinuxInputMouseHandler(const QString &key, const QString &specification) +QEvdevMouseHandler *QEvdevMouseHandler::create(const QString &device, const QString &specification) { #ifdef QT_QPA_MOUSE_HANDLER_DEBUG - qWarning() << "Try to create mouse handler with" << key << specification; -#else - Q_UNUSED(key) + qWarning() << "Try to create mouse handler for" << device << specification; #endif - QString device = "/dev/input/event0"; bool compression = true; int jitterLimit = 0; @@ -80,28 +77,21 @@ QEvdevMouseHandler *QEvdevMouseHandler::createLinuxInputMouseHandler(const QStri compression = false; else if (arg.startsWith("dejitter=")) jitterLimit = arg.mid(9).toInt(); - else if (arg.startsWith(QLatin1String("/dev/"))) - device = arg; } -#ifdef QT_QPA_MOUSE_HANDLER_DEBUG - qDebug("evdevmouse: Using device %s", qPrintable(device)); -#endif - int fd; fd = qt_safe_open(device.toLocal8Bit().constData(), O_RDONLY | O_NDELAY, 0); if (fd >= 0) { - return new QEvdevMouseHandler(fd, compression, jitterLimit); + return new QEvdevMouseHandler(device, fd, compression, jitterLimit); } else { qWarning("Cannot open mouse input device '%s': %s", qPrintable(device), strerror(errno)); return 0; } } -QEvdevMouseHandler::QEvdevMouseHandler(int deviceDescriptor, bool compression, int jitterLimit) - : m_notify(0), m_x(0), m_y(0), m_prevx(0), m_prevy(0), - m_fd(deviceDescriptor), m_compression(compression), - m_buttons(0) +QEvdevMouseHandler::QEvdevMouseHandler(const QString &device, int fd, bool compression, int jitterLimit) + : m_device(device), m_fd(fd), m_notify(0), m_x(0), m_y(0), m_prevx(0), m_prevy(0), + m_compression(compression), m_buttons(0) { setObjectName(QLatin1String("Evdev Mouse Handler")); -- cgit v1.2.3