QT 4.7 cannot receive multi-touch events.

  • I've wrote a multi-touch device driver, which created /dev/input/event4 multi-touch event. and it's been tested by mtdev, but when I use QT touch example "fingerpaint" to test multi-touch, it seems QT cannot recognize multi-touch events produced by /dev/input/event4.

    (None of TouchBegin/TouchUpdate/TouchEnd ever triggered)

    bool ScribbleArea::event(QEvent *event)
    switch (event->type()) {
    case QEvent::TouchBegin:
    case QEvent::TouchUpdate:

    case QEvent::TouchEnd:


    So I wander if QT is hard coded to use other input event device instead of /dev/input/event4 ?
    Is there any way to fix this problem? thanks!

    [EDIT: code formatting, please wrap in @-tags, Volker]

  • Assuming this is about desktop X11 builds: Unlike Qt 5, Qt 4 has no proper evdev touch input support.

    You don't see anything in fingerpaint because there is nothing that would feed touch events into QApplication. There is some evdev code in qapplication_x11.cpp but that's not compiled in by default and is specific to certain hardware. So with 4.7 your best chance is to enable and fix the code in question.

    Alternatively you can write your own evdev handling code and feed touch events to Qt via the internal (but exported) function qt_translateRawTouchEvent().

  • yes, it's x86 desktop X11 builds and Thanks!

    so using Qt5 will also be a solution? Is there a stable Qt5 release available for download?

  • Moderators

    No, it's not even in alpha yet. It's planned to be released in summer 2012. You can grab current code on Gitorious - it usually works.

  • Roger, Thank you very much!

  • Moderators

    Oh, and to save you some time: here's a manual on how to set it up: "LINK":http://developer.qt.nokia.com/wiki/Building_Qt_5_from_Git.

  • Well, at least in Qt 5 we have a "generic" plug-in in qtbase/src/plugins/generic/touchscreen (be sure to check README about how to set it up) which serves touch events straight from evdev. It should be usable with any of the Linux-based platforms (xcb, eglfs, etc.). Note that the plug-in in question is still work in progress.

  • OK, Thank you all again.

  • Oh, sorry to bother you guys again. If my multi-touch evdev can't work for Qt, how can other multi-touch device works? If Qt can't support multi-touch device then what's Qt TouchBegin/TouchUpdate/TouchEnd event used for? I mean, we all uses standard Linux multi-touch "ABS_MT_" events, if Qt do support multi-touch devices, why Qt support other multi-touch devices and can't support mine? what are the differences?

    If I have to use Qt5 or implement custom Qt codes to use my multi-touch evdev, shouldn't it be the same case with all other multi-touch devices?

  • after some digging, i found Bradley T. Hughes's original post about how QT multi-touch support is created. I've got a better understanding now. So here is how I understand Qt multi-touch support on Linux, please correct me if I'm wrong.

    In Window 7, QT uses multi-touch API directly to implements multi-touch event.
    But in Linux , Qt rely on X11 input events, though Linux kernel/driver now supports multi-touch devices, X11 does not support multi-touch events, that's why we've to do our own Qt x11 implementation.

    Am I correct?

  • http://cgit.freedesktop.org/xorg/driver/xf86-input-evdev/log/

    xinput-evdev driver only just merged the multitouch features:

    2011-12-22 Merge branch 'multitouch'

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.