Friday, July 25th 2008, 2:40am UTC+1

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

Posts: 39

Location: Philly

1

Thursday, July 28th 2005, 5:16pm

more touchscreen issues

I'm using an InHand development board, and if I run qpe, the touchscreen works. However if I run an example program that I complied from the qt-2.3.3 source code with patches for InHand, the touchscreen doesn't seem to respond.

I have QTDIR=/opt/QtPalmtop
LD_LIBRARY_PATH=/opt/QtPalmtop/lib
and i run ./buttongroups -qws &

I read some of the other posts and i dont have those files that everybody wants to modify like /QTDIR/src/libraries/custom-.....
  • Go to the top of the page

Posts: 39

Location: Philly

2

Friday, September 2nd 2005, 3:41pm

RE: more touchscreen issues

ok, today was a big day for me, I can make the mouse move on my touchscreen!!! I achieved this feat by going into qwsmouse_qws.cpp and commenting the crap out of it. Luckily my drivers were allready working and I was getting interrupts from cat /proc/intterupts when i would touch the screen when running my master (-qws) example program (buttongroups). So by commenting the qwsmouse_qws.cpp file I was able to monitor the data (x and y positions of my touch) and I found that the patched source code that i got from InHand was transforming the data and putting it off the screen for example if I had (125, 30) it might transform it to (-855, 350). I have to clean up the code so that i get the axis situated correctly and make the touch respond more cleanly. I was trying to use qt 3.3.4 a while ago, but now I am back to qt 2.3.2 which came with my development board, once i get this working better, i might try to go back up to qt3.

back to battle...
  • Go to the top of the page

emmdom

Trainee

Posts: 56

Location: New Mexico

Occupation: Embedded Programmer

3

Friday, September 2nd 2005, 5:33pm

Hello

Today must be one of those good days because with the help of Paul from trolltech tech support my touchscreen is now working. Turns out after a week of debugging all that need to be done was comment out certian lines of code. I commented out anything that had to do with the IPAQ in qmouselinuxtp.cpp but this is the line that was holding everything up.
# if defined(QT_QWS_IPAQ_RAW) || defined(QT_QWS_EBX_RAW)
mousePos = handler->transform( mousePos );
# endif
So know the touchscreen works somewhat. There is still some jittering from the mouse pointer and it seems to disappear here and there and then when it appears it looks like it comming from off the screen. And the calibration is a little off but that shouldn't be to hard to fixs. This is in qt-e-3.3.4


Thanks to Paul and Paal from trolltech tech support for all the help. And well as put by phatbeatsboy BACK TO THE BATTLE....
emmdom

This post has been edited 1 times, last edit by "emmdom" (Sep 2nd 2005, 5:35pm)

  • Go to the top of the page

sar_van81

Trainee

Posts: 52

Location: India

Occupation: Embedded Programmer

4

Tuesday, February 27th 2007, 4:54am

hi,

i'm working in qt-3.3.5. can you say me how did u make your touch screen to work ? i'm using serial touch screen (3M Microtouch ). i could not do that. i gave the "-qt-mouse-linuxtp" as configure options ,but still no movements. when i execute the qtapplicaiton and touch the touch screen the cursor disappears.

can anyone provide me suggestions and solutions for this ?

i got stuck with this problem ? for teh past one month i'm trying but could not succeed .?

can anyone please help me ?

thanks in advance,

saravanan
saravanan
  • Go to the top of the page

Posts: 39

Location: Philly

5

Tuesday, February 27th 2007, 2:12pm

The fact that when you touch the screen, the mouse disappears means that the touch screen is working, the only problem is that qt is interpreting your touches incorrectly. Hopefully you are using linux, I was able to modify the file qmouselinuxtp_qws.cpp under the qt src/embedded dir. I started out by adding lots of informational output to help me find where I was getting off track. I think my biggest problem with the cursor disappearing was that I was getting lots of invalid touches, ie a good touch would report a x and y value inside the viewing area, while something about the serial interface of the touchscreen was giving four or five values for each touch. I modified the scale_event function as follows:

static void scale_event(TS_EVENT *event)
{
int x = event->x;
int y = event->y;
static int prevx = 0, prevy = 0;

// printf("raw data = (%i , %i)\r\n", x, y);

if (x == 0 || y == 0 || x > 1000 || y > 1000) {
event->x = prevx;
event->y = prevy;
}
// printf("new raw data = (%i , %i)\r\n\r\n", event->x, event->y);
prevx = event->x;
prevy = event->y;
}

I would recommend first just putting alot of comments in this file and recompiling qt so that you have a good understanding of how the touchscreen moves the mose through QT and you can see exactly what the problem is.

good luck!
  • Go to the top of the page

emmdom

Trainee

Posts: 56

Location: New Mexico

Occupation: Embedded Programmer

6

Tuesday, February 27th 2007, 3:46pm

Hello sar_van81


Are you calibrating you screen. I had the same problem after I modified the file phatbeatsboy modified. QT sent me a calibration app which you can find in trolltechs documentation on there web site under developer zone.


You might want to calibrate the screen so the cursor knows where it is on the screen.

Hope this helps

Emmanuel
emmdom
  • Go to the top of the page

sar_van81

Trainee

Posts: 52

Location: India

Occupation: Embedded Programmer

7

Tuesday, February 27th 2007, 5:24pm

hi phatbeatsboy,

thanks for the reply. can you say me in which file is the function scale_event present ?
i searched in qmouselinuxtp_qws.cpp. but could not find that ?

i gave printf all over this file and found that the x and y coordinates that are recieved from the touch screen are as follows:

mousePos x and Y are: 24006 27995
old mouse x and y :21447 20720

i analyzed the code and found that the above values are compared with QT_QWS_TP_MOVE_LIMIT values
( the if loop below in the file qt/qmouselinuxtp_qws.cpp
if ( dxSqr + dySqr < (QT_QWS_TP_MOVE_LIMIT * QT_QWS_TP_MOVE_LIMIT) ) )
. in my case the value of QT_QWS_TP_MOVE_LIMIT in only 100 and the values of dxsqr and dysqr are in the range of 6548481 52925625. its calculated as follows:

QPoint dp = mousePos - oldmouse;
int dxSqr = dp.x() * dp.x();
int dySqr = dp.y() * dp.y();

the values of mousePos and oldmouse are as follows:

mousePos x and Y are: 24006 27995
old mouse x and y :21447 20720.

. only if the above condition is satisfied the mouse postions is changed . else its not.

i believe in my case since this is not satisfied.

also i have a doubt. till now the caliberated values does not play any role. its values are useful only when it comes inside this ifdefined section:

# if defined(QT_QWS_IPAQ_RAW) || defined(QT_QWS_EBX_RAW)
mousePos = handler->transform( mousePos );
# endif.

since i'm using serial touch screen , should i need to calibrate my touch screen ?if so how to calibrate it ?
saravanan
  • Go to the top of the page

sar_van81

Trainee

Posts: 52

Location: India

Occupation: Embedded Programmer

8

Tuesday, February 27th 2007, 5:30pm

hi emmdom,

thanks for the reply. can you say me which file u modified when you had the same problem ?
also can you say me where is the calibration apps in the developers zone documentation from trolltech website ? i searched but could get the location

is there any way to calibrate serial touch screen ?
saravanan
  • Go to the top of the page

Posts: 39

Location: Philly

9

Tuesday, February 27th 2007, 9:56pm

what is your hardware and operating system setup?
  • Go to the top of the page

emmdom

Trainee

Posts: 56

Location: New Mexico

Occupation: Embedded Programmer

10

Tuesday, February 27th 2007, 10:21pm

I had a really hard time getting the touchscreen. As you tell if you searched there aren't many answers about the problems.

Here is the link to qt docs similar what qt sent me. It is for qt 4.2 but I am sure you can get it to work on your version.

http://doc.trolltech.com/4.2/qtopiacore-…ration-cpp.html

Hope this helps

Emmanuel
emmdom

This post has been edited 1 times, last edit by "emmdom" (Feb 27th 2007, 10:21pm)

  • Go to the top of the page

sar_van81

Trainee

Posts: 52

Location: India

Occupation: Embedded Programmer

11

Wednesday, February 28th 2007, 2:48am

hi phatbeatsboy,

the following are the details:

Hardware :BF537 EZKIT.
Operating Sytem ported into the board: uClinux
qt version : qt-embedded-free-3.3.5
saravanan
  • Go to the top of the page

sar_van81

Trainee

Posts: 52

Location: India

Occupation: Embedded Programmer

12

Wednesday, February 28th 2007, 2:50am

hi emmdom,

thank you for the link. i'l surely try and will let you know the results .
saravanan
  • Go to the top of the page

sar_van81

Trainee

Posts: 52

Location: India

Occupation: Embedded Programmer

13

Wednesday, February 28th 2007, 5:04am

hi emmdom,

i think i can't adopt that calibration application for my qt version . in qt-3.3.5 we dont have the class QWSPointerCalibrationData. i searched in the docs and got the following lines from the file qt/qmouse_qws.cpp:

Source code

1
2
3
4
5
\fn ( QWSPointerCalibrationData * )

    This method is reimplemented in the calibrated mouse handler to
    set calibration information (from, for instance, the Qtopia
    calibration screen). This version does nothing.

the remaining things i managed to alter with respect to my version but this class i could not .
saravanan
  • Go to the top of the page

Posts: 39

Location: Philly

14

Wednesday, February 28th 2007, 1:56pm

If you look around your qmouse_qws.cpp file, you will notice that your calibration functions are in this file and that your calibration information is under /etc/pointercal on your filesystem. On line 232 in qmouselinuxtp_qws.cpp you'll notice the line

mousePos = handler->transform( mousePos );

this line applies your calibration info to the average mousePos from the last press. If you comment out that line you will see the raw value from the tocuhscreen. Also you should put a printf right at the beginning of the "if(data->pressure......)" (around line 212) statement so you can see every point that the touchscreen reports. In my debugging of my touchscreen I found that my raw data points that were good were greater than 0 and less than 1000. With every press the touchscreen would report some invalid Points, ie points that had a 0 x or y value or greater than 1000. Which is why in the scale event function in my version of QT i added:

if (x == 0 || y == 0 || x > 1000 || y > 1000) {
event->x = prevx;
event->y = prevy;
}

this ignores the bad points. Eventually you will need to get a cal program up and running, but first comment out that transform() line and look at raw data.
  • Go to the top of the page

emmdom

Trainee

Posts: 56

Location: New Mexico

Occupation: Embedded Programmer

15

Wednesday, February 28th 2007, 4:28pm

Here you go. This should help a lot of people I know I could have used this a year ago. The original code was provided to me by Paul from TrollTech CS.

Emmanuel


Calibration.cpp

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#include "calibration.h"
#include <qwindowsystem_qws.h>
#include <qpainter.h>
#include <qgfx_qws.h> // for qt_screen
#include <qfile.h>
 
#include <qtimer.h>
#include <qapplication.h>
 
 
Calibration::Calibration() : QDialog( 0, 0, TRUE, WStyle_Customize | WStyle_StaysOnTop)
{
 
    QRect desk = qApp->desktop()->geometry();
    setGeometry( 0, 0, desk.width(), desk.height() );
 
    setFocusPolicy( StrongFocus );
    setFocus();
 
    backup = 0;
    idx = 0;
    data = new QWSPointerCalibrationData;
 
    int w = qt_screen->deviceWidth();
    int h = qt_screen->deviceHeight();
 
    int delta = QMIN(w, h)/20;
 
    data->screenPoints[QWSPointerCalibrationData::TopLeft]  = QPoint(delta, delta);
    data->screenPoints[QWSPointerCalibrationData::BottomLeft]  = QPoint(delta, h-delta);
    data->screenPoints[QWSPointerCalibrationData::BottomRight]  = QPoint(w-delta, h-delta);
    data->screenPoints[QWSPointerCalibrationData::TopRight]  = QPoint(w-delta, delta);
    data->screenPoints[QWSPointerCalibrationData::Center]  = QPoint(w/2, h/2);
 
 
/*    data->screenPoints[QWSPointerCalibrationData::TopLeft]  = QPoint(delta, delta);
    data->screenPoints[QWSPointerCalibrationData::BottomLeft]  = QPoint(delta, w-delta);
    data->screenPoints[QWSPointerCalibrationData::BottomRight]  = QPoint(h-delta, w-delta);
    data->screenPoints[QWSPointerCalibrationData::TopRight]  = QPoint(h-delta, delta);
    data->screenPoints[QWSPointerCalibrationData::Center]  = QPoint(h/2, w/2);
*/
  /*  data->screenPoints[QWSPointerCalibrationData::TopLeft]  = QPoint(delta, delta);
    data->screenPoints[QWSPointerCalibrationData::BottomLeft]  = QPoint(w-delta, delta);
    data->screenPoints[QWSPointerCalibrationData::BottomRight]  = QPoint(h-delta, w-delta);
    data->screenPoints[QWSPointerCalibrationData::TopRight]  = QPoint(delta,h-delta);
    data->screenPoints[QWSPointerCalibrationData::Center]  = QPoint(h/2, w/2);
*/
 
    for (int i = 0; i < 5; ++i)
        displayPoints[i] = qt_screen->mapFromDevice( data->screenPoints[i], QSize(w, h) );
}
 Calibration::~Calibration()
{
    delete data;
    delete backup;
}
 
void Calibration::paintEvent(QPaintEvent*)
{
    QPainter p(this);
 
    p.fillRect(rect(), blue);
    QPoint cp = data->screenPoints[idx];
    p.fillRect(cp.x()-6, cp.y()-1, 13, 3, black);
    p.fillRect(cp.x()-1, cp.y()-6, 3, 13, black);
}
 
 
 
void Calibration::mouseReleaseEvent(QMouseEvent *me)
{
//    qDebug("Calibration::mouseReleaseEvent (%d,%d) idx %d", me->pos().x(), me->pos().y(), idx);
 
    data->devPoints[idx] = qt_screen->mapToDevice( me->pos(),
                                                   QSize(qt_screen->width(), qt_screen->height()) );
    ++idx;
 
    if (idx >= 5){
        accept();
        repaint();}
    else
        repaint();
}
 
 
void Calibration::show()
{
    if ( !isVisible() && QWSServer::mouseHandler() ) {
        idx = 0;
        delete backup;
        backup = 0;
        if (QFile::exists("/etc/pointercal")) {
            backup = new QWSPointerCalibrationData;
                QWSServer::mouseHandler()->getCalibration(backup);
        }
        QWSServer::mouseHandler()->clearCalibration();
    }
    grabMouse();
    QDialog::show();
    setActiveWindow();
}
 
static void showCalibration(const QWSPointerCalibrationData *data)
 {
 
    int i;
    qDebug("screenPoints:");
    for (i=0;i<5;i++){
        QPoint p = data->screenPoints[i];
        qDebug(" %d: (%d %d)", i, p.x(), p.y());
     }
    qDebug("devPoints:");
    for (i=0;i<5;i++){
        QPoint p = data->devPoints[i];
        qDebug(" %d: (%d %d)", i, p.x(), p.y());
     }
 
}
 
void Calibration::accept()
{
    if ( idx == 5 ) {
        qDebug("Calibrating device");
        showCalibration(data);
        QWSServer::mouseHandler()->calibrate(data);
 
        QWSPointerCalibrationData cal;
        QWSServer::mouseHandler()->getCalibration(&cal);
        qDebug("Actual device calibration:");
        showCalibration(&cal);
    }
 
    QDialog::accept();
}
 
void Calibration::reject()
{
    if (backup)
        QWSServer::mouseHandler()->calibrate(backup);
 
    QDialog::reject();
}



calibration.h

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef CALIBRATION_H
#define CALIBRATION_H
 
#include <qdialog.h>
#include <qmouse_qws.h>
 
class QWSPointerCalibrationData;
 
class Calibration : public QDialog
{
    Q_OBJECT
public:
    Calibration();
    ~Calibration();
    void show();
protected:
 
    void paintEvent(QPaintEvent*);
    void mouseReleaseEvent(QMouseEvent*);
    void accept();
    void reject();
 
private:
    int idx;
    //const QWSPointerCalibrationData cal;
    QWSPointerCalibrationData *data;
    QPoint displayPoints[5];
    QWSPointerCalibrationData *backup;
};
 
 
#endif
emmdom
  • Go to the top of the page

sar_van81

Trainee

Posts: 52

Location: India

Occupation: Embedded Programmer

16

Thursday, March 1st 2007, 6:38am

hi,

i have a basic doubt about the access of ttyS1 port by qt. i had connected the serial touch screen to "/dev/ttyS1" . i had modified the qmouselinuxtp_qws.cpp as follows :

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
QWSLinuxTPMouseHandlerPrivate::QWSLinuxTPMouseHandlerPrivate( QWSLinuxTPMouseHandler *h )
    : mouseFD(-1), samples(QT_QWS_TP_SAMPLE_SIZE), currSample(0), lastSample(0),
    numSamples(0), skipCount(0), handler(h)
{
printf("\n inside ltp handler private \n");
#if defined(QT_QWS_IPAQ)
# ifdef QT_QWS_IPAQ_RAW
    if ((mouseFD = open( "/dev/h3600_tsraw", O_RDONLY | O_NDELAY)) < 0) {
# else
    if ((mouseFD = open( "/dev/h3600_ts", O_RDONLY | O_NDELAY)) < 0) {
# endif
	qWarning( "Cannot open /dev/h3600_ts (%s)", strerror(errno));
	return;
    }
#elif defined(QT_QWS_EBX)
//# ifdef QT_QWS_EBX_TSRAW
# if 0
    if ((mouseFD = open( "/dev/tsraw", O_RDONLY | O_NDELAY)) < 0) {
        qWarning( "Cannot open /dev/tsraw (%s)", strerror(errno));
       return;
    }
# else
    if ((mouseFD = open( "/dev/ts", O_RDONLY | O_NDELAY)) < 0) {
        qWarning( "Cannot open /dev/ts (%s)", strerror(errno));
        return;
     }
# endif
#endif

	mouseFD = open( "/dev/ttyS1", O_RDONLY | O_NDELAY);
	printf("\n MOUSEFD :%d",mouseFD);

	if(mouseFD==0)
	printf("\n device openneeee \n");
	else printf("\n cannot oepn touch screen \n");

    QSocketNotifier *mouseNotifier;
    mouseNotifier = new QSocketNotifier( mouseFD, QSocketNotifier::Read, this );

printf("\n after socket notifier \n");
    connect(mouseNotifier, SIGNAL(activated(int)),this, SLOT(readMouseData()));
    waspressed=FALSE;
    mouseIdx = 0;
printf("\n after mouseidx \n");

}
.

so this will surely open the port "/dev/ttyS1". when it calls this open function should it call the touch screen driver in uclinux ?

why i'm asking is that i could not see any printk statements which i gave in mtouch.c in the uclinux ?

is driver necessary for this ?

also i will calibrate the touch screen and message you. till now i was analyzing as to why the printk statements did not come.
saravanan
  • Go to the top of the page

sar_van81

Trainee

Posts: 52

Location: India

Occupation: Embedded Programmer

17

Thursday, March 1st 2007, 8:14am

hi emmdom,

i run the calibration application.the cross hair is displayed ,but when i press the touch screen nothing happens.i mean the printf in qmouselinuxtp_qws.cpp are being displayed each time when i touch the screen. i dont know whats happening inside .

i think i'm missing some more information .i mean in the uclinux side (OS).
saravanan
  • Go to the top of the page

emmdom

Trainee

Posts: 56

Location: New Mexico

Occupation: Embedded Programmer

18

Thursday, March 1st 2007, 5:21pm

Hello

I think this will fix your problem. This is what I had to do when I was getting simaler results.

In qt-embedded in /src/embedded open the file qmouselinuxtp_qws.cpp. At around line 232 you will find this code:

Source code

1
2
3
4
5
6
7
8
9
10
mousePos = totalMousePos / (sampleCount - 1);
 
# if defined(QT_QWS_IPAQ_RAW) || defined(QT_QWS_EBX_RAW)
                mousePos = handler->transform( mousePos );
# endif
                if(!waspressed)
                    oldmouse = mousePos;
                QPoint dp = mousePos - oldmouse;
                int dxSqr = dp.x() * dp.x();
                int dySqr = dp.y() * dp.y();



comment out the "#if defined" and the "#endif". I hope this helps

Emmanuel
emmdom
  • Go to the top of the page

sar_van81

Trainee

Posts: 52

Location: India

Occupation: Embedded Programmer

19

Friday, March 2nd 2007, 4:57am

hi emmdom,

ok i'l try.but i think for this i need to calibrate the touch screen.i could not calibrate the touch screen since its connected to serial. i tried using tslib package but still could not. in the tslib package i configured with the input raw module. there too when i run the calibration program "ts_calibrate", it says the "device you have connected is not a touch screen".

also i have an idea. since the touch screen is connected to serial port, can't we write a serial port reception program wherein we can read the data coming from the serial touch screen and find the coordinates ? is this possible ?
saravanan
  • Go to the top of the page

emmdom

Trainee

Posts: 56

Location: New Mexico

Occupation: Embedded Programmer

20

Friday, March 2nd 2007, 4:34pm

Hello

Well that is to bad that didn't help the problem. That should work I haven't ever done it but I don't see why it shouldn't work. But before you go and do that look back in qmouselinuxtp_qws.cpp and you will notice that it calls for devices from /dev/? around line 153. There are some more #if defined(QT_QWS_IPAQ) and #ifdef QT_QWS_IPAQ_RAW. Look at what I did compared to what is given. Try doing the same if you want it might fix the problem faster. Also I would probably go through this file and remove all the #ifdef and #ifdefined that makes the code usable to only one device.

Hope this helps.

Dont get discouraged it took me a long time to work out all the bugs and I still have some issues with the touchscreen.

This is what the original should look like.

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
QWSLinuxTPMouseHandlerPrivate::QWSLinuxTPMouseHandlerPrivate( QWSLinuxTPMouseHandler *h )
    : mouseFD(-1), samples(QT_QWS_TP_SAMPLE_SIZE), currSample(0), lastSample(0),
    numSamples(0), skipCount(0), handler(h)
{
#if defined(QT_QWS_IPAQ)
# ifdef QT_QWS_IPAQ_RAW
    if ((mouseFD = open( "/dev/h3600_tsraw", O_RDONLY | O_NDELAY)) < 0) {
# else
    if ((mouseFD = open( "/dev/h3600_ts", O_RDONLY | O_NDELAY)) < 0) {
# endif
        qWarning( "Cannot open /dev/h3600_ts (%s)", strerror(errno));
        return;
    }
#elif defined(QT_QWS_EBX)
//# ifdef QT_QWS_EBX_TSRAW
# if 0
    if ((mouseFD = open( "/dev/tsraw", O_RDONLY | O_NDELAY)) < 0) {
        qWarning( "Cannot open /dev/tsraw (%s)", strerror(errno));
       return;
    }
# else
    if ((mouseFD = open( "/dev/ts", O_RDONLY | O_NDELAY)) < 0) {
        qWarning( "Cannot open /dev/ts (%s)", strerror(errno));
        return;
     }
# endif
#endif
 
    QSocketNotifier *mouseNotifier;
    mouseNotifier = new QSocketNotifier( mouseFD, QSocketNotifier::Read,
                                         this );
    connect(mouseNotifier, SIGNAL(activated(int)),this, SLOT(readMouseData()));
    waspressed=FALSE;
    mouseIdx = 0;
}








This is what mine looks like: Try using my class and change /dev/ts to what ever the serial port is using for the touchpanel in /dev.

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
QWSLinuxTPMouseHandlerPrivate::QWSLinuxTPMouseHandlerPrivate( QWSLinuxTPMouseHandler *h )
    : samples(QT_QWS_TP_SAMPLE_SIZE), currSample(0), lastSample(0),
    numSamples(0), skipCount(0), handler(h)
{  //I am changing this to /dev/digi changing back to ts in order to fix a problem
    if ((mouseFD = open( "/dev/ts", O_RDONLY | O_NDELAY)) < 0) {
        qWarning( "Cannot open /dev/ts (%s)", strerror(errno));
        return;
    }
 
    QSocketNotifier *mouseNotifier;
    mouseNotifier = new QSocketNotifier( mouseFD, QSocketNotifier::Read,
                                         this );
    connect(mouseNotifier, SIGNAL(activated(int)),this, SLOT(readMouseData()));
    waspressed=FALSE;
    mouseIdx = 0;
}



Emmanuel
emmdom
  • Go to the top of the page

Rate this thread