diff options
author | Laszlo Agocs <laszlo.p.agocs@nokia.com> | 2012-06-01 10:36:51 +0300 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-06-04 22:29:10 +0200 |
commit | bc3cfebc66a046e0c6548624ada9f49701faf0d1 (patch) | |
tree | 4079021a383ea0e2785b179f4e55976ddf8cdb82 /src/platformsupport/devicediscovery | |
parent | 13714cdd64d96b0c37c8120143c03436900c256d (diff) |
evdevtablet plugin
Change-Id: Ie8fbaac929180e6d4c626253c4c20d1b3a9083f5
Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
Diffstat (limited to 'src/platformsupport/devicediscovery')
3 files changed, 12 insertions, 1 deletions
diff --git a/src/platformsupport/devicediscovery/qdevicediscovery_p.h b/src/platformsupport/devicediscovery/qdevicediscovery_p.h index 3bec6928bf..c4b9124277 100644 --- a/src/platformsupport/devicediscovery/qdevicediscovery_p.h +++ b/src/platformsupport/devicediscovery/qdevicediscovery_p.h @@ -72,7 +72,8 @@ public: Device_Touchscreen = 0x04, Device_Keyboard = 0x08, Device_DRM = 0x10, - Device_InputMask = Device_Mouse | Device_Touchpad | Device_Touchscreen | Device_Keyboard, + Device_Tablet = 0x20, + Device_InputMask = Device_Mouse | Device_Touchpad | Device_Touchscreen | Device_Keyboard | Device_Tablet, Device_VideoMask = Device_DRM }; Q_DECLARE_FLAGS(QDeviceTypes, QDeviceType) diff --git a/src/platformsupport/devicediscovery/qdevicediscovery_static.cpp b/src/platformsupport/devicediscovery/qdevicediscovery_static.cpp index 3b6b6f40ca..2d89493d6b 100644 --- a/src/platformsupport/devicediscovery/qdevicediscovery_static.cpp +++ b/src/platformsupport/devicediscovery/qdevicediscovery_static.cpp @@ -162,6 +162,11 @@ bool QDeviceDiscovery::checkDeviceType(const QString &device) qWarning() << "DeviceDiscovery found touchscreen at" << device; #endif ret = true; + } else if ((m_types & Device_Tablet) && (testBit(BTN_STYLUS, bitsKey) || testBit(BTN_TOOL_PEN, bitsKey))) { +#ifdef QT_QPA_DEVICE_DISCOVERY_DEBUG + qWarning() << "DeviceDiscovery found tablet at" << device; +#endif + ret = true; } } } diff --git a/src/platformsupport/devicediscovery/qdevicediscovery_udev.cpp b/src/platformsupport/devicediscovery/qdevicediscovery_udev.cpp index f7fe7cb87c..eed12212af 100644 --- a/src/platformsupport/devicediscovery/qdevicediscovery_udev.cpp +++ b/src/platformsupport/devicediscovery/qdevicediscovery_udev.cpp @@ -132,6 +132,8 @@ QStringList QDeviceDiscovery::scanConnectedDevices() udev_enumerate_add_match_property(ue, "ID_INPUT_TOUCHSCREEN", "1"); if (m_types & Device_Keyboard) udev_enumerate_add_match_property(ue, "ID_INPUT_KEYBOARD", "1"); + if (m_types & Device_Tablet) + udev_enumerate_add_match_property(ue, "ID_INPUT_TABLET", "1"); if (udev_enumerate_scan_devices(ue) != 0) { #ifdef QT_QPA_DEVICE_DISCOVERY_DEBUG @@ -241,6 +243,9 @@ bool QDeviceDiscovery::checkDeviceType(udev_device *dev) if ((m_types & Device_Touchscreen) && (qstrcmp(udev_device_get_property_value(dev, "ID_INPUT_TOUCHSCREEN"), "1") == 0)) return true; + if ((m_types & Device_Tablet) && (qstrcmp(udev_device_get_property_value(dev, "ID_INPUT_TABLET"), "1") == 0)) + return true; + if ((m_types & Device_DRM) && (qstrcmp(udev_device_get_subsystem(dev), "drm") == 0)) return true; |