From 43c4d909c574db40d2d73b0bb04ece78746cb039 Mon Sep 17 00:00:00 2001 From: Jon Trulson Date: Fri, 2 Nov 2012 15:47:19 -0600 Subject: [PATCH] evdevtouch: also use BTN_TOUCH with value == 0 to detect TouchPointReleased The current code seems to rely on an event, ABS_MT_TOUCH_MAJOR with a value of 0 to detect a touch release. Not all devices[0] emit this, and the spec[1] does not specify this behavior. So, add a check for a BTN_TOUCH with a value of 0 to also indicate Qt::TouchPointReleased. [0] http://www.chalk-elec.com/?page_id=1280#!/~/product/category=3094861&id=14647624 using hid_ntrig kernel module. [1] https://www.kernel.org/doc/Documentation/input/multi-touch-protocol.txt Change-Id: I4fc8ff404cad2083a57ff18737c5ea2b06d8ceac Reviewed-by: Robert Daniels Reviewed-by: Laszlo Agocs --- src/platformsupport/input/evdevtouch/qevdevtouch.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/platformsupport/input/evdevtouch/qevdevtouch.cpp b/src/platformsupport/input/evdevtouch/qevdevtouch.cpp index 0a3bd8d669..9dd607b425 100644 --- a/src/platformsupport/input/evdevtouch/qevdevtouch.cpp +++ b/src/platformsupport/input/evdevtouch/qevdevtouch.cpp @@ -350,6 +350,11 @@ void QEvdevTouchScreenData::processInputEvent(input_event *data) m_currentSlot = data->value; } + } else if (data->type == EV_KEY && !m_typeB) { + if (data->code == BTN_TOUCH && data->value == 0) + { + m_contacts[m_currentSlot].state = Qt::TouchPointReleased; + } } else if (data->type == EV_SYN && data->code == SYN_MT_REPORT && m_lastEventType != EV_SYN) { // If there is no tracking id, one will be generated later.