Multitouch question...

I want to use multitouch for preventing finger(s) holding a tablet stopping all other actions for the (other) input finger on the screen BUT: When setting a focus like this on a screen image:

local targetID=event.id local target = event.target display.getCurrentStage():setFocus( target,targetID ) target.isFocus = true

targetID is the event.id for the touch.

This code lines are not stopping the target from jumping on the screen to position inputs for all fingers on the screen, as soon the fingers are moved. What am I doing wrong here?

How can I use multitouch to catch a finger on screen but allow inputs from other fingers on the screen?

Is it possible I’m using the wrong listener here?

And what about “tap” events?

Any help welcome?

Thx!

Hi Daniela,

Did you try to model the example shown here?

https://docs.coronalabs.com/api/event/touch/id.html

And as a note, “tap” events don’t extend to multitouch, only “touch” events do.

Brent

fwiw, might want to ask if this is android?

i don’t know about ios, but on android the sample Brent linked to won’t work properly.

to demo, add a line inside the listener like print(event.phase), then witness:

press and hold first touch on object (began phase occurs)

now press and hold second touch on object (no began phase will occur)

now release first touch on object (ended phase occurs)

now release second touch on object (ended phase occurs - even though you didn’t get the began)

(so obviously it never increments the count and prints the ‘being multitouched’ message)

or try this sequence:

press and hold first (began occurs)

press-hold-release second (no event phases at all)

release first (ended occurs)

Hi Daniela,

Did you try to model the example shown here?

https://docs.coronalabs.com/api/event/touch/id.html

And as a note, “tap” events don’t extend to multitouch, only “touch” events do.

Brent

fwiw, might want to ask if this is android?

i don’t know about ios, but on android the sample Brent linked to won’t work properly.

to demo, add a line inside the listener like print(event.phase), then witness:

press and hold first touch on object (began phase occurs)

now press and hold second touch on object (no began phase will occur)

now release first touch on object (ended phase occurs)

now release second touch on object (ended phase occurs - even though you didn’t get the began)

(so obviously it never increments the count and prints the ‘being multitouched’ message)

or try this sequence:

press and hold first (began occurs)

press-hold-release second (no event phases at all)

release first (ended occurs)