Multi touch response time

Member
Posts: 64
Joined: 2008.10
Post: #1
Does anyone know what the response time of the iphone tactical screen is like? I mean the lag time from when you touch the screen until your application receives the touch event.
Thanks for any info.
Quote this message in a reply
Moderator
Posts: 613
Joined: 2004.09
Post: #2
I dont have exact numbers for you but it is very low, I would say a little bit longer the keyboard entry delay on a computer.

Kyle Richter
DragonForged.com
Twitter: @kylerichter
Quote this message in a reply
Member
Posts: 64
Joined: 2008.10
Post: #3
Ok. Thanks for the answer Smile
Quote this message in a reply
Member
Posts: 93
Joined: 2008.11
Post: #4
Hi,

You can get the actual time of the touch from the event you receive into your handler. Besides that there are ways to get touches delivered faster but that will cost you a bit of your FPS...

Alex

TapMania - iPhone StepMania // Human knowledge belongs to the world!
Quote this message in a reply
Member
Posts: 51
Joined: 2009.02
Post: #5
godexsoft Wrote:Hi,

You can get the actual time of the touch from the event you receive into your handler. Besides that there are ways to get touches delivered faster but that will cost you a bit of your FPS...

Alex

Faster ways? How would that be? Is there a lower-level, but still SDK-friendly, way to get touch info?

Is there any clever way to get all current fingers when there are no events happening?
Quote this message in a reply
Member
Posts: 93
Joined: 2008.11
Post: #6
Nosredna Wrote:Faster ways? How would that be? Is there a lower-level, but still SDK-friendly, way to get touch info?

Is there any clever way to get all current fingers when there are no events happening?

Hi,

I do like this..
1) Have a though run loop: while(g_bRunning) { ... }
2) Make time for system event handling using this code:
while( CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.009, FALSE) == kCFRunLoopRunHandledSource);
Basically here you can tune the speed of event handling against FPS... for me 0.009 is a good value.. the lower that value is - the higher FPS and lower input performance you get.
3) Create a JoyPad class to save current input states (last time of button release, last time of button press, isHolding bool value, etc.)
For my case I had a JoyPad with 4 active buttons.. I just forward all my input to that singleton class and the rest is done there.

HTH,
Alex

TapMania - iPhone StepMania // Human knowledge belongs to the world!
Quote this message in a reply
Member
Posts: 51
Joined: 2009.02
Post: #7
OK. That's pretty much what I did. I had buttons at the bottom and a drag area at the top. I kept track of which finger was where by using the info given to me (current x and y and previous x and y).

Problem I had is that if the user was crazy enough with a bunch of fingers, I would sometimes get spurious events and couldn't find a match for the finger. Possibly I was getting events out of order. You have to be really manic to do this, but the outcome can be severe--a button that stays down until it's pressed again, which is very bad for autorepeat controls, as I had.

Eventually I used AllTouches to see even the unmoved fingers, but I still am only able to look at them when an event comes to me. What I'm wondering is if there's a way to see all the touches even if no event has happened.
Quote this message in a reply
Member
Posts: 446
Joined: 2002.09
Post: #8
Nosredna Wrote:Eventually I used AllTouches to see even the unmoved fingers, but I still am only able to look at them when an event comes to me. What I'm wondering is if there's a way to see all the touches even if no event has happened.
If no there's no event you can safely assume that nothing has changed since you last checked. Events will and do arrive out of order, but since the UITouch objects are persistent for as long as a touch exists you can (re)identify individual touches using NSObject's hash property or with a weak pointer to the object.
Quote this message in a reply
Member
Posts: 51
Joined: 2009.02
Post: #9
Frank C. Wrote:If no there's no event you can safely assume that nothing has changed since you last checked. Events will and do arrive out of order, but since the UITouch objects are persistent for as long as a touch exists you can (re)identify individual touches using NSObject's hash property or with a weak pointer to the object.

That's great info. Can you explain the hash property just a bit? I'm not sure how to do that. (Long-time dev, but newbie to Objective-C.)
Quote this message in a reply
Member
Posts: 446
Joined: 2002.09
Post: #10
The hash is just a unique identifier for any NSObject e.g. uid = [touch hash]. So, if you save off the hashes and states for each touch you can track how each once has changed from event to event (the hashes stay the same from touchbegan to touchended).
Quote this message in a reply
Member
Posts: 51
Joined: 2009.02
Post: #11
Frank C. Wrote:The hash is just a unique identifier for any NSObject e.g. uid = [touch hash]. So, if you save off the hashes and states for each touch you can track how each once has changed from event to event (the hashes stay the same from touchbegan to touchended).

Thanks! I appreciate your time. I'll try that.
Quote this message in a reply
Member
Posts: 87
Joined: 2006.08
Post: #12
Frank C. Wrote:The hash is just a unique identifier for any NSObject e.g. uid = [touch hash]. So, if you save off the hashes and states for each touch you can track how each once has changed from event to event (the hashes stay the same from touchbegan to touchended).

That seems unnecessary. The pointer value itself is a unique identifier, that will remain constant across the deliveries of many UIEvents from the sane touch sequence.
Quote this message in a reply
Member
Posts: 446
Joined: 2002.09
Post: #13
Frogblast Wrote:That seems unnecessary. The pointer value itself is a unique identifier, that will remain constant across the deliveries of many UIEvents from the sane touch sequence.
Sure, that works fine too - to quote my initial post:
Quote:...you can (re)identify individual touches using NSObject's hash property or with a weak pointer to the object.
Either way I don't see how you can avoid saving off a copy (of at least the pointer). You can't track multiple touches over several events unless you have something saved for comparison (unless I'm totally missing something?). Personally I save off copies for a bunch of reasons, not the least of which is that I need the touch data to be accessible from plain C code - the hash just seemed to be a better choice for my purposes.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Enable Multi-Touch? MrPenguin9 4 3,793 Mar 14, 2010 12:55 PM
Last Post: MrPenguin9
  Multi-touch failing Sumaleth 1 2,605 Feb 24, 2010 08:49 PM
Last Post: Sumaleth
  Multi touch individual fingers jjslay 3 3,265 Jun 18, 2009 10:01 AM
Last Post: jjslay
  Multi Touch wonza 7 5,499 Mar 21, 2009 03:06 AM
Last Post: wonza
  How to POST to PHP (and read the response)? Lostlogic 9 5,215 Jan 21, 2009 08:28 AM
Last Post: Lostlogic