Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9144399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T10:15:36+00:00 2026-06-17T10:15:36+00:00

I am using Qt 4.8.3 on a small ARM embedded Linux device with a

  • 0

I am using Qt 4.8.3 on a small ARM embedded Linux device with a touchscreen. I have my touchscreen configured with tslib and calibrated it so there is a pointercal file in /etc/. The locations of my touch events work just fine but no matter what I get a QEvent for Mouse Move before Mouse Press or Mouse Release Events. Furthermore, I don’t get any Mouse Related Events until I physically lift my finger from the touchscreen. I need normal behavior where I press on the touchscreen and receive a mouse down event immediately and then my move events ( if there are any ) and then a mouse release event when I lift my finger.

So what I'm seeing from the point of view of events received when I pressed down and then release looks like:

50 SockAct <-- Received right at press down
           <-- NO Other events received until press released
           <-- Now release by lifting finger from screen
50 SockAct <-- Immediately received a 50 ( SockAct ) and the rest of the events below:
2          <-- 2 == mouse down
2          <-- 2 == mouse down
3          <-- 3 == mouse release / up
3          <-- 3 == mouse release / up
77         <-- 77 == redraw

I also attempted to look at the QWS Server events by implementing the following qwsEventFilter to watch QWS events that come in to my QApplication:

/// For investigation mouse events
#include <QWSServer>
#include <QWSMouseHandler>
#include <QWSEvent>

bool GUIApp::qwsEventFilter(QWSEvent *e)
{

    qDebug() << e->type;

    if(e->type == QWSEvent::Mouse) {

        QWSMouseHandler *curMouse = QWSServer::mouseHandler();
        qDebug() << "mouse position is: " << curMouse->pos();

    }

    return false;

    /*
    QWSEvent::NoEvent   0   No event has occurred.
    QWSEvent::Connected 1   An application has connected to the server.
    QWSEvent::Mouse 2   A mouse button is pressed or released, or the mouse cursor is moved. See also Qt for Embedded Linux Pointer Handling.
    */

}

Now, when I launch my App I am seeing the same behavior after touching the screen — that is the following is printed:

2 <-- Nothing is printed until I release my finger from the screen!
mouse position is:  QPoint(89,312) 
2 
mouse position is:  QPoint(89,312) 

As you can see as soon as I release my finger I get 2 events, presumably press down and release.

I’ve run ‘evtest’ on my /dev/input/touchscreen device in Linux and certainly see a touch down event immediately when pressing down on the screen. And I do not get a mouse release event until I lift my finger, so the driver behaves as expected. There are also no ‘repeat’ touch down events when I press – it is just one event for one press down , but behaves correctly.

I’m not sure why I’m seeing the behavior I do. There must be a translation issue between Qt and the input device.

Furthermore, If I add a small 3ms delay in processing my MouseButtonRelease received event, then I get desired behavior in terms of how the app works but I still do not receive my Mouse events until I release the press. I should not have to add a delay at all, I would expect my mouse down to happen, then any moves, and finally a mouse up event in turn

Does anybody know how to fix this or what may be causing this?? Thank you very much!

—

I don’t see the following printed out until I actually lift my finger:

...
MOVE TYPE:  5 
"Mouse move (382,129)" 
MOUSE BUTTON PRESS TYPE:  2 
"Mouse Button Press (1)" 
MOUSE BUTTON RELEASE TYPE:  3 
"Mouse Button Release (1)" 
....

Here is my eventFilter where I examine my received events in my App:

////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Just for kicks print out the mouse position
if (event->type() == QEvent::MouseButtonPress)
{
    qDebug() << "MOUSE BUTTON PRESS TYPE: " << event->type();
    QMouseEvent *mouseEvent = static_cast<QMouseEvent*>(event);
    qDebug() << QString("Mouse Button Press (%1)").arg(mouseEvent->button());
}
if (event->type() == QEvent::MouseMove)
{
    qDebug() << "MOVE TYPE: " << event->type();
    QMouseEvent *mouseEvent = static_cast<QMouseEvent*>(event);
    qDebug() << QString("Mouse move (%1,%2)").arg(mouseEvent->globalX()).arg(mouseEvent->globalY());
}
if (event->type() == QEvent::MouseButtonRelease)
{
    qDebug() << "MOUSE BUTTON RELEASE TYPE: " << event->type();
    QMouseEvent *mouseEvent = static_cast<QMouseEvent*>(event);
    delay();
    qDebug() << QString("Mouse Button Release (%1)").arg(mouseEvent->button());
    //return true; // Gobble the event
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////

Here is my delay function:

void Monitor::delay()
{
    QTime dieTime = QTime::currentTime().addMSecs(3);
    while( QTime::currentTime() < dieTime )
    QCoreApplication::processEvents(QEventLoop::AllEvents, 100);
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T10:15:37+00:00Added an answer on June 17, 2026 at 10:15 am

    Solved- I found this thread: https://github.com/kergoth/tslib/issues/10 which outlines the same problem. It seems to be an issue in Tslib with the Atmel MXT Maxtouch driver. Commenting out the Variance module in the ts.conf file solved my problem – I now get mouse down events immediately after touching the screen.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I already have a functional embedded linux system using MontaVista. My embedded board boots
I got a probably small problem using memcmp. I have two arrays (length =
I'm developing a small application using Blend, basically what I have in my application
I have a C++ small project using GNU Make. I'd like to be able
this is a small program using Java Scanner which reads a file of double
I'm using a small CMS for a small site ( http://www.ovlu.li/cms/ ). There I
I have datagridviews on windows form, i am adding records to datagridview using small
I've been working on an embedded OS for ARM, However there are a few
I'm using prebuilt libs (libsox.so et al) and I'm using a small test file
I am using small plugin to jquery: jquery-plugin-autoresize But i have trouble with using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.