PDA

View Full Version : QTouchEvent issue



turcomas
28th February 2012, 11:14
Hi all,
I am working with QT Creator on a basic application trying to catch touch pad events: basic single finger touch events and then I would like to investigate multi-touch (by using an external Logitech multi-touch pad).
I am using a “standard” ASUS laptop, with its own embedded touchpad.
As OS I am using Ubuntu 11.04 release., with Qt 4.7.
As reference I used the fingerpaint project here: http://doc.qt.nokia.com/4.7-snapshot/touch-fingerpaint.html

But I ***can’t catch*** any of the event
QEvent::TouchBegin
QEvent::TouchUpdate
QEvent::TouchEnd
But just mouse events.

See ScribbleArea::event(QEvent *event) in the scribblearea.cpp

Any help? Could it be due to the fact that the touchpad driver has a behavior like the mouse?
How can I catch the finger event, when I pass it on the touch pad?

Thanks in advance for you help
Massimiliano

high_flyer
2nd March 2012, 10:56
I'd expect that a regular touch pad would generate mouse events, not touch events...
I'd try it on a device with a touch screen for example, or a with a touch pad which supports multiple touch points.

turcomas
6th March 2012, 09:02
I'd expect that a regular touch pad would generate mouse events, not touch events...
I'd try it on a device with a touch screen for example, or a with a touch pad which supports multiple touch points.

Hi,
thanks for the feedback.
I tried with a "Logitech Wireless touchpad" (http://www.logitech.com/en-us/mice-pointers/mice/devices/8417)
and I continue to ***not*** be able to catch any of the event
QEvent::TouchBegin
QEvent::TouchUpdate
QEvent::TouchEnd
but just mouse events.

any help to solve this issue, would be much appreciated

thanks in advance
M

lamp
30th January 2013, 18:24
bool window::event(QEvent *tevent)
{
....
....
....

return QWidget::event(tevent);

}

skumararaja@gmail.com
23rd December 2014, 14:14
Hi,

Any answers for this question? I do have the same problem.

Thanks for your help!

Best Regards,
Kumar

d_stranz
23rd December 2014, 19:14
Touch pads are not touch screens. As far as Qt is concerned, touch pads are mouse devices. It is irrelevant that you use them by touching them with your finger; that's a hardware detail.

If you want an app to see touch events, you have to use a touch screen or something that emulates one.

anda_skoa
24th December 2014, 10:55
My understanding is that some touch pads are multi touch capable, i.e. like touch screens.

However, Qt is not involved there at all. If the input system does only report mouse events, it only has mouse events to work with.
If the input system reports touch events, then Qt passes those on as well.

Cheers,
_

d_stranz
24th December 2014, 17:56
Yes, I probably should have said " As far as Qt is concerned, if the OS treats a touch pad as a mouse device, then Qt sees only mouse events".

I guess one could write a driver that would treat a touch pad like a touch screen, but a finger is a pretty big and blunt pointing device in relation to the size of the touch pad. (Although the same relative sizes pertain to cell phone screens, I suppose).