10

As far as I can tell the iPhone multitouch framework sends the location of each touch but not the size.

I want to allow the user to tap a button with the tip of their thumb, or to put the pad of their thumb across multiple buttons (not real UIButtons) and have my touch tracking code realize it needs to press all the buttons the thumb is over.

Chris Hanson
  • 54,380
  • 8
  • 73
  • 102
Alex Wayne
  • 178,991
  • 47
  • 309
  • 337

4 Answers4

15

All these answers are wrong. The fact that Apple doesn't appear to sanction this in apps on the store is a different matter.

 float vf = 10.0; 
 id valFloat = [thisTouch valueForKey:"pathMajorRadius"]; 
 if(valFloat != nil) {
   vf = [valFloat floatValue]; 
 }

I really wish that this issue would get pushed harder by users and developers.

hhafez
  • 38,949
  • 39
  • 113
  • 143
Rob
  • 1,387
  • 1
  • 13
  • 18
  • `valueForKey:` is not technicaly a private API, is it? It just lets you dig up private values... Is this cool or not cool with App store poilicies? – Alex Wayne Dec 22 '10 at 02:43
  • 1
    I like the way you think. :-) Let me know if you get your app approved with that explaination, and my app gets resubmitted the next day! (The issue is the "pathMajorRadius" property, valueForKey is a legitimate public means of avoiding a dynamic link. You don't access this private info statically, and in fact, might only end up reading it through some ... rare... and umm... complex path.) – Rob Dec 22 '10 at 05:17
  • I too, wish for access to this. It would make programming "flick" style gesture recognizers much easier. I should hope that isn't "the point" in restricting this. – StCredZero Feb 03 '13 at 18:59
  • 1
    Apple sanctions these calls now. They pulled my app that was using it, but it is now explicitly documented and allowed now. – Rob Jul 29 '14 at 22:12
5

Since UITouch handles the touch and nothing is said about the size, i'd say no you can't. You better try another approch like a drag..

CiNN
  • 9,752
  • 6
  • 44
  • 57
  • drag might be a good idea. Make it so it doesn't stop pressing the first button until you end your drag so you can press button A, drag to button B and both are being pressed. I might try this. – Alex Wayne Feb 07 '09 at 22:37
3

I'm fairly sure that the hardware gets a very accurate read of the touched area, but the iPhone firmware does not bring this information to the developer. As CiNN said, UITouch just doesn't provide this information.

However, the hardware is the same as in the old Fingerworks.com products which really did provide the actual touch data to the developer. So perhaps in a (much) later OS release, touch surface profiles would be provided. it might be useful!

Torben Gundtofte-Bruun
  • 2,104
  • 1
  • 24
  • 34
0

No, that is not possible using UIKit.

Rog
  • 17,070
  • 9
  • 50
  • 73