This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Can't get touch event DM3730 on Linux 2.6.37 and QT

Other Parts Discussed in Thread: DM3730

Hello!

My goal is to make a QT application for Technexion DevKit TDM-3730 BlizzardPack. Everything is OK, but it is impossible to click a button with a touchscreen, while with mouse it's ok.

I've tried evtest, here its output:

root@devkit:/dev/input# evtest touchscreen0
Input driver version is 1.0.1
Input device ID: bus 0x0 vendor 0x0 product 0x0 version 0x0
Input device name: "prism_st"
Supported events:
  Event type 0 (Sync)
  Event type 1 (Key)
    Event code 330 (Touch)
  Event type 3 (Absolute)
    Event code 0 (X)
      Value    115
      Min        0
      Max     1499
    Event code 1 (Y)
      Value    397
      Min        0
      Max      899
    Event code 24 (Pressure)
      Value      0
      Min        0
      Max      255
Testing ... (interrupt to exit)
Event: time 10551.906098, type 3 (Absolute), code 0 (X), value 735
Event: time 10551.906129, type 3 (Absolute), code 1 (Y), value 461
Event: time 10551.906129, type 3 (Absolute), code 24 (Pressure), value 255
Event: time 10551.906129, -------------- Report Sync ------------
Event: time 10551.915772, type 3 (Absolute), code 0 (X), value 734
Event: time 10551.915772, type 3 (Absolute), code 1 (Y), value 460
Event: time 10551.915802, -------------- Report Sync ------------
Event: time 10551.925201, type 3 (Absolute), code 0 (X), value 733
Event: time 10551.925201, type 3 (Absolute), code 1 (Y), value 459
Event: time 10551.925232, -------------- Report Sync ------------
Event: time 10551.934570, type 3 (Absolute), code 0 (X), value 732
Event: time 10551.934600, -------------- Report Sync ------------
Event: time 10551.943999, type 3 (Absolute), code 0 (X), value 730
Event: time 10551.944030, type 3 (Absolute), code 1 (Y), value 460
Event: time 10551.944030, -------------- Report Sync ------------
Event: time 10551.951659, type 3 (Absolute), code 0 (X), value 728
Event: time 10551.951690, type 3 (Absolute), code 1 (Y), value 462
Event: time 10551.951690, type 3 (Absolute), code 24 (Pressure), value 28
Event: time 10551.951690, -------------- Report Sync ------------
Event: time 10551.959014, type 3 (Absolute), code 0 (X), value 726
Event: time 10551.959044, type 3 (Absolute), code 1 (Y), value 464
Event: time 10551.959044, type 3 (Absolute), code 24 (Pressure), value 1
Event: time 10551.959044, -------------- Report Sync ------------

No matter how much I tapped there is no touch event (330).

I've made a GTK application and it's ok, but it isn't convenient at all. And it seems that touch-event processing realized inside GTK GUI. Am I right?

Here is my system parameters:

Host - Linux Mint 15, Linux version 3.8.0-19-generic, QT 5

Target - Angstrom, Linux version 2.6.37, qt4-embedded - 4.7.3-r33.1.9, tslib

Cpu - TI Sitara DM3730 @ 1Ghz

DSP Core - TMS320C64x+™ @ 800Mhz

Thank you in advance.

Egor

  • Hi Egor,

    Have you verified that your touch screen is exported to QT, when you start, just like as show bellow in your QT start up

    export TSLIB_TSDEVICE=/dev/input/touchscreen0

    export QWS_MOUSE_PROTO=Tslib:/dev/input/touchscreen0

    Thanks,

    Sreenivas

  • Hi, Sreenivas.

    Yes, these variables are exported, but it makes no sence(

    I've also tried to disable x server:

    root@devkit:~# update-rc.d -f gpe-dm remove
    update-rc.d: /etc/init.d/gpe-dm exists during rc.d purge (continuing)
     Removing any system startup links for gpe-dm ...
      /etc/rc0.d/K20gpe-dm
      /etc/rc1.d/K20gpe-dm
      /etc/rc2.d/S99gpe-dm
      /etc/rc5.d/S99gpe-dm
      /etc/rc6.d/K20gpe-dm

    and then execute

    root@devkit:~# ./qte-example -qws

    I really don't know why qtButtons can't be clicked?!!

    please, help!

  • Hi,

    Please find that your Qt source code has enabled touch screen event to accept as your widget needs to have "QT::WA AcceptTouchEvents" attribute set and then graphics items should have "acceptTouchEvents" attribute to true.

  • You are using an evdev input, and that is not (well) supported in Qt4, refer to below:

    https://bugreports.qt-project.org/browse/QTBUG-25329

    You might have better success if you can use tslib.

    Alternatively, you can move to Qt5 where evdev as well as Tslib are well supported.

  • Sreenivas Kowtharapu said:

    Please find that your Qt source code has enabled touch screen event to accept as your widget needs to have "QT::WA AcceptTouchEvents" attribute set and then graphics items should have "acceptTouchEvents" attribute to true.

    I'm a beginner at QT (and at Embedded systems), so I don't quite understand where should i insert it. I'm followwing Derek Molloy tutorial http://www.youtube.com/watch?v=kP7uvOu9hoQ on BeagleBOne. But I have Technexion devkit. Beaglebone linux version is 3.2.34 and mine is 2.6.37.

    Here is my test program main.cpp:

    #include "mainwindow.h"
    #include <QApplication>
    #include <QTouchEvent>

    int main(int argc, char *argv[])
    {
        QApplication a(argc, argv);
        MainWindow w;
        w.show();
        
        return a.exec();
    }

    and here is mainwindow.cpp:

    #include "mainwindow.h"
    #include "ui_mainwindow.h"

    MainWindow::MainWindow(QWidget *parent) :
        QMainWindow(parent),
        ui(new Ui::MainWindow)
    {
        ui->setupUi(this);
    }

    MainWindow::~MainWindow()
    {
        delete ui;
    }

    void MainWindow::on_pushButton_clicked()
    {
        ui->lineEdit->setText("DevKit");
    }

    And in Derek's tutorial it works ok. Could you tell me how I can enable qt source code to accept touch screen events?

  • Prabindh Sundareson said:

    You are using an evdev input, and that is not (well) supported in Qt4, refer to below:

    https://bugreports.qt-project.org/browse/QTBUG-25329

    You might have better success if you can use tslib.

    Alternatively, you can move to Qt5 where evdev as well as Tslib are well supported.

    I haven't mentioned evdev anywhere, only evtest. TsLib is installed on Technexion kit. And i think i'm using it, as there is TSLIB_TSDEVICE=/dev/input/touchscreen0 in environment variables.

  • Any suggestions?

    Is it even possible to make a QT GUI application for this dev kit with touchscreen? What I'm doing wrong?

  • Yes, it is possible.

  • Cool) And what next? any advice?

  • Use QT5 for your code instead of QT4, where you can use evdev input ;)

  • I'd like to, but my Target device has Angstrom Linux with kernel version 2.6.37, which doesn't support qt5