setTapDelay doesn't work for android?

does system.setTapDelay() work on android?

It works for me on osx but doesn’t seem to work on android or corona simulator on windows (works in sim on mac)

I basically have a case where there’s two objects which can overlap on the screen, and one object would do something on a single tap, and the other would do something on a double tap

If i double tap, the single tap object also gets called (if no tapdelay is set)

When i set the tap delay on osx (to something like 0.5 for example), double tapping doesnt cause the object that listens for single tap to execute, i.e. working as intended, however on windows this does not seem to affect anything [import]uid: 121569 topic_id: 33514 reply_id: 333514[/import]

There are differences between iOS and Android when dealing with touch and tap events. iOS touch/tap events occur as they happen and Android touch events are saved and sent out every frame (30 or 60 times a second).

The best thing to do is use touch events and the “time” parameter to determine the delay between touches so you can create your own single tap and double tap events. [import]uid: 7559 topic_id: 33514 reply_id: 133226[/import]

There are differences between iOS and Android when dealing with touch and tap events. iOS touch/tap events occur as they happen and Android touch events are saved and sent out every frame (30 or 60 times a second).

The best thing to do is use touch events and the “time” parameter to determine the delay between touches so you can create your own single tap and double tap events. [import]uid: 7559 topic_id: 33514 reply_id: 133226[/import]

I think I have a solution that utilizes taps instead of touches. This is the code I’ve used and it seems to work well for me.

[lua]

local theTable = {}

local function listenerFunction(event)

    if event.name = “tap” then

        table.insert(theTable, true) – You could really insert anything here, like the number 1, or false, or whatever

        local function tempListener(event)

            if #theTable > 1 then – Alternatively, use #theTable == 2 if you want to specifically listener for 2 taps

                – Do something

            else

                – Do something else

            end

            theTable = {}

        end

        if #theTable == 1 then

            timer.performWithDelay(400, tempListener) – I’ve put a delay of 400, you can use whatever you want

        end

    end

end

[/lua]

I think I have a solution that utilizes taps instead of touches. This is the code I’ve used and it seems to work well for me.

[lua]

local theTable = {}

local function listenerFunction(event)

    if event.name = “tap” then

        table.insert(theTable, true) – You could really insert anything here, like the number 1, or false, or whatever

        local function tempListener(event)

            if #theTable > 1 then – Alternatively, use #theTable == 2 if you want to specifically listener for 2 taps

                – Do something

            else

                – Do something else

            end

            theTable = {}

        end

        if #theTable == 1 then

            timer.performWithDelay(400, tempListener) – I’ve put a delay of 400, you can use whatever you want

        end

    end

end

[/lua]