Thursday, November 4, 2010

Yet another patch to TSLIB

Once you get everything running on the TS-TPC-73xx you'll probably notice some strange behavior from your touchscreen when you're trying to interact with applications.

When you first open a QT app and tap a widget, the mouse pointer doesn't seem to have a pre-defined location so everything works like it should that first tap. If you watch what is going on  in ts_test you can see that you'll get a few readings at the place you tap with pressure=255 then when you let up you will see a final reading at those X,Y coordinates and pressure=0.

Now when you tap on again what you actually get is this:
$Timestamp:     OLD Xpos     OLD Ypos     255
$Timestamp:     OLD Xpos     OLD Ypos     0
$Timestamp:     NEW Xpos     NEW Ypos      255
$Timestamp:     NEW Xpos     NEW Ypos      255
$Timestamp:     NEW Xpos     NEW Ypos      255
$Timestamp:     NEW Xpos     NEW Ypos      0

To fix it I modified the dejitter filter. In dejitter.c do the following

     Change this:
    if (djt->nr == 1)
        samp [count] = *s;

    To this:
       if (djt->nr  ==  1){
                        samp [count].tv = s->tv;
                        samp [count].x = s->x;
                        samp [count].y = s->y;
                        samp [count].pressure = 0;
                    }

Of course for this to work you need to make sure that you call the dejitter filter in your ts.conf file (if you use the settings I did this will already be taken care of for you).

No comments:

Post a Comment