SSK2: Tap event on an auto listener doesn't fire. Touch does

Version of SSK you are using:   2017.006 PRO

Version of Corona SDK you are using: Version 2017.3022 (2017.1.11)

OS you are developing under.  OSX Version 10.12.2

Where you are encountering the issue: Simulator

Error Message(s): None

Issue: Using the example provide in RGDocs, the touch event works.

When ‘touch’ is changed to ‘tap’, it does not trigger the event.

 

local function onTap( self, event)    if( event.phase == "ended" ) then       print("I tapped: " .. self.myName )    end    return false end local icnWeather = ssk.display.newImageRect(mainmenu,100,400,"assets/icnWeather.png",{w=150,h=150, touch = onTap, myName = "weather" }) -- This works local icnBus = ssk.display.newImageRect(mainmenu,100,500,"assets/icnBus.png",{w=150,h=150, tap = onTap, myName = "bus" }) -- This doesn't (If i change to touch it does)

I’ll look into this and get back to you! :slight_smile:

Ah, I see the problem.

The tap event doesn’t have phases.

https://docs.coronalabs.com/api/event/tap/index.html

You need to do this:

local function onTouch( self, event) if( event.phase == "ended" ) then print("I touched: " .. self.myName ) end return false end local function onTap( self, event) print("I tapped: " .. self.myName ) return false end local icnWeather = ssk.display.newImageRect(mainmenu,100,400,"assets/icnWeather.png", { w=150, h=150, touch = onTouch, myName = "weather" } ) local icnBus = ssk.display.newImageRect(mainmenu,100,500,"assets/icnBus.png", { w=150, h=150, tap = onTap, myName = "bus" } )

Just a side note.  This is why I don’t use tap events in my apps and games.  I don’t like the fact that it has no phases.  :wacko:

I only included it in SSK2’s short list of AutoListenersbecause so many other users like it.

Ah yes, I didn’t spot that.

Thank you Ed, pretty darned good customer response for a Sunday  :wink:

I’ll try to keep you less busy tomorrow  :smiley:

I’ll look into this and get back to you! :slight_smile:

Ah, I see the problem.

The tap event doesn’t have phases.

https://docs.coronalabs.com/api/event/tap/index.html

You need to do this:

local function onTouch( self, event) if( event.phase == "ended" ) then print("I touched: " .. self.myName ) end return false end local function onTap( self, event) print("I tapped: " .. self.myName ) return false end local icnWeather = ssk.display.newImageRect(mainmenu,100,400,"assets/icnWeather.png", { w=150, h=150, touch = onTouch, myName = "weather" } ) local icnBus = ssk.display.newImageRect(mainmenu,100,500,"assets/icnBus.png", { w=150, h=150, tap = onTap, myName = "bus" } )

Just a side note.  This is why I don’t use tap events in my apps and games.  I don’t like the fact that it has no phases.  :wacko:

I only included it in SSK2’s short list of AutoListenersbecause so many other users like it.

Ah yes, I didn’t spot that.

Thank you Ed, pretty darned good customer response for a Sunday  :wink:

I’ll try to keep you less busy tomorrow  :smiley: