Multi touch issues on Droidx

I am currently using the trial sdk on windows to write an app for android and am having trouble with the mutlitouch. I believe I have found a significant bug, however it could simply be misuse the functionality.

In a nutshell, if a touch event moves outside the bounds of an object, the system will stop sending touch events to that object. The easiest way to demonstrate this is to add code to the example DragMeMultitouch:

Here is the modified onTouch function:
[lua]local function onTouch( event )
local t = event.target

– Print info about the event. For actual production code, you should
– not call this function because it wastes CPU resources.
printTouch(event)

local phase = event.phase
if “began” == phase then
– Make target the top-most object
local parent = t.parent
parent:insert( t )
display.getCurrentStage():setFocus( t, event.id )

– Spurious events can be sent to the target, e.g. the user presses
– elsewhere on the screen and then moves the finger over the target.
– To prevent this, we add this flag. Only when it’s true will “move”
– events be sent to the target.
t.isFocus = true

– Store initial position
t.x0 = event.x - t.x
t.y0 = event.y - t.y

t.alpha = 0.5
elseif t.isFocus then
if “moved” == phase then
– Make object move (we subtract t.x0,t.y0 so that moves are
– relative to initial grab point, rather than object “snapping”).
t.x = event.x - t.x0
t.y = event.y - t.y0
elseif “ended” == phase or “cancelled” == phase then
display.getCurrentStage():setFocus( t, nil )
t.isFocus = false

t.alpha = 1
end
end

– Important to return true. This tells the system that the event
– should not be propagated to listeners of any objects underneath.
return true
end[/lua]

When the boxes are touched for the first time, they turn transparent. When they are released, they become opaque again.

The problem occurs when I drag my finger fast enough that it exits out of the box’s touch box. In the example above, the box will remain transparent because its ended/cancelled event does not get called.

Is anyone else having this problem? And could someone try this on a different model phone, as it may only be the Droidx that has this issue.

Thanks in advance,
-Jake [import]uid: 42133 topic_id: 8053 reply_id: 308053[/import]

Also you can only push two buttons at the same time not three or more [import]uid: 11459 topic_id: 8053 reply_id: 28702[/import]

Just an update,
I can confirm that what maxbarrow said is true, multitouch is limited to two touches.

In addition, the original problem appears to not be multitouch related, as it happens in my application even with multitouch disabled. [import]uid: 42133 topic_id: 8053 reply_id: 28945[/import]

Hi,

The issue you describe (if a touch event moves outside the bounds of an object, the system will stop sending touch events to that object) was fixed a while ago. I just tried to reproduce the issue with DragMeMultiTouch (and your modified onTouch handler) on a Droid X but could not, no matter how fast I drag my finger on an object.

What version of the Corona Windows SDK build are you using?

Tim [import]uid: 8196 topic_id: 8053 reply_id: 29018[/import]

I am using version 2011.377. Here is a (10$ camera) video of the issue.

Video [import]uid: 42133 topic_id: 8053 reply_id: 29109[/import]

I figure I should post an update to this.

It appears, after extensive testing, that on the first touch event.id is ‘nil’. The second touch however, is properly returning the touch id.

At this point I am almost ready to purchase a Pro subscription, and it would be nice to know if this has been fixed in the full edition.

Thanks in advance,
-Jake [import]uid: 42133 topic_id: 8053 reply_id: 30760[/import]