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:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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

Also you can only push two buttons at the same time not three or more

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.

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

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

Video

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

views:1722 update:2011/10/9 9:57:41
corona forums © 2003-2011