Skip navigation.
Home
The QNX Community Portal

View topic - How to handle two events or callbacks simultaneously?

How to handle two events or callbacks simultaneously?

Isn't the name clear?

How to handle two events or callbacks simultaneously?

Postby ab » Thu Mar 05, 2009 9:58 pm

Hi all,
How to handle two events simultaneously?

For eg.
Consider two buttons (b1, b2) in your project.
On pressing them simultaneously (touch screen), both the events (for each button) should be handled.
Is there any possibility?

In other words,
Press and hold b1 and at the same time press b2.
Now i want to handle the events of both b1 and b2.

Eagerly Waiting for reply...
ab
New Member
 
Posts: 2
Joined: Thu Mar 05, 2009 9:56 pm

RE: How to handle two events or callbacks simultaneously?

Postby juanplacco » Thu Mar 05, 2009 10:03 pm

I think is not possible, I guess it's a limitation of the touch screen monitor. If you press two different positions simultaneously, the driver sends to photon one only average possition of the event...

Is just a guess...

JM
juanplacco
Senior Member
 
Posts: 318
Joined: Wed May 17, 2006 2:30 pm

RE: How to handle two events or callbacks simultaneously?

Postby ab » Thu Mar 05, 2009 10:16 pm

I need it for my project. Is it possible using timers (in button callbacks)?

I tried using timer. I used two buttons (b1 and b2) and a label (label1 with font color white).
In b1's arm callback, a flag is also setted and one second timer (generating pulse) is triggered.
In the b2's arm callback, the same flag is resetted.
In timer function, the flag state is checked.
if flag is setted, then change font color(some color) of label1.
if flag is resetted, then label1's font color is resetted to white.
But i not got the expected result?
Means, the label1's font color is not resetted. (simultaneous press of both buttons)
ab
New Member
 
Posts: 2
Joined: Thu Mar 05, 2009 9:56 pm

RE: How to handle two events or callbacks simultaneously?

Postby CrankSoftware » Fri Mar 06, 2009 6:53 pm

what type of touchscreen is it? resistive or capacitive

I don't think you can touch two places at the same time with a resistive touchscreen. The coordinate that gets sent to the app, when 2 fingers are touching the screen, will probably be the half way point between both fingers. A simple app that prints out the touch coordinates and button up and down status will probably give you a lot of insight.

Jason
CrankSoftware
Active Member
 
Posts: 37
Joined: Wed Jul 16, 2008 5:37 pm

Re: RE: How to handle two events or callbacks simultaneously

Postby rgallen » Tue Mar 10, 2009 3:15 pm

CrankSoftware wrote:what type of touchscreen is it? resistive or capacitive

I don't think you can touch two places at the same time with a resistive touchscreen. The coordinate that gets sent to the app, when 2 fingers are touching the screen, will probably be the half way point between both fingers. A simple app that prints out the touch coordinates and button up and down status will probably give you a lot of insight.

Jason


Apples two year exclusivity period on the multi-touch technology has expired. You'll see multi-touch touch screens everywhere soon...
rgallen
QNX Master
 
Posts: 671
Joined: Thu Jul 11, 2002 6:48 pm

RE: Re: RE: How to handle two events or callbacks simultaneo

Postby CrankSoftware » Tue Mar 10, 2009 7:42 pm

True. But they'll probably be capacitive touchscreens, not resistive. The common resistive touchscreen that most people have today can't support it because of a hardware limitation, not a patent issue. If you have a capacitive touchscreen it probably already supports multi-touch.
CrankSoftware
Active Member
 
Posts: 37
Joined: Wed Jul 16, 2008 5:37 pm

Re: RE: Re: RE: How to handle two events or callbacks simult

Postby rgallen » Wed Mar 11, 2009 2:56 pm

CrankSoftware wrote:True. But they'll probably be capacitive touchscreens, not resistive. The common resistive touchscreen that most people have today can't support it because of a hardware limitation, not a patent issue. If you have a capacitive touchscreen it probably already supports multi-touch.


Yes, but even capacitive touch screens require a special controller, and that is where the patent applies. The patent still applies, but it is now being widely licensed by the holder.

My point was that questions about multi-touch will likely become common...

There is no mouse equivalent (mouse can't be in two different places at the same time - M theory excepted :-), so it requires support in the human input subsystem.
rgallen
QNX Master
 
Posts: 671
Joined: Thu Jul 11, 2002 6:48 pm


Return to GUI Programming

Who is online

Users browsing this forum: No registered users and 1 guest