Detect if multitouch is available


Note: I originally posted this as a question in the developer support forum(http://developer.anscamobile.com/forum/2011/11/02/detect-multitouch-capability), but I now realize that this is an important feature missing from the API, so I’m re-posting it as a feature request.

It could be very useful if we can detect during runtime if multitouch was successfully activated. Maybe the best solution to this is if system.activate() could return a boolean. Something like this:

[code]
–[[ Pseudo-code:
–(This doesn’t really work, since the system.activate API doesn’t --return anything, but it should explain what I’m trying to accomplish)
–]]

–again, I know the next line is not supposed to work…
local multiTouchIsOn = system.activate(“multitouch”);

if multiTouchIsOn then
–Multitouch is working on this device, use pinch zoom
else
–No multitouch available on this device, draw a zoom slider
end
[/code] [import]uid: 33608 topic_id: 17240 reply_id: 317240[/import]

better yet, if such a feature was implemented, I think it would be more useful if it returned a number, which would reference the total number of supported touchpoints (if that’s a possibility).

For example, some devices only support 2 touchpoints, while others (iPad) support up to 11!

so

[lua]local multiTouchIsOn = system.activate(“multitouch”);[/lua]

should really return anything from a 1 to 11. [import]uid: 49447 topic_id: 17240 reply_id: 65094[/import]

I posted this approach with your thread in the Developer Forum as producerism has prescribed above. Single touch is the default, just flag if you turn multitouch on in your app. You control if multitouch is enabled.

-David [import]uid: 96411 topic_id: 17240 reply_id: 65112[/import]

Hi David, I don’t understand. How do you you know if the device supports multitouch to begin with? (unless you compile a long list of supporting devices, which is very impractical).

If you try to turn multitouch on with

system.activate("multitouch");  

you will not know if was activated on this device, so you can’t set a flag.

[import]uid: 33608 topic_id: 17240 reply_id: 65118[/import]

I have a similar question, what happens if we call

system.activate( "multitouch" )

on a device that doesn’t have multitouch capabilities. Is the call just a no-op? Or might it crash or something?

–wunderwuzzi [import]uid: 118947 topic_id: 17240 reply_id: 83922[/import]