lua - Touch Hold Event In corona SDK -


i wondering how check if user has touched screen, holding touch down , not moving. please if have can go from. ive been looking around , have yet find handle this.

you can use/modify this: (it's rob miracle says)

local holding = false local function enterframelistener()     if holding         -- holding button         -- code here         -- code here         -- code here     else         -- not holding         -- code here         -- code here         -- code here     end end  local function touchhandler( event )     if event.phase == "began"         display.getcurrentstage():setfocus( event.target )         event.target.isfocus = true         runtime:addeventlistener( "enterframe", enterframelistener )         holding = true     elseif event.target.isfocus         if event.phase == "moved"         elseif event.phase == "ended"             holding = false             runtime:removeeventlistener( "enterframe", enterframelistener )             display.getcurrentstage():setfocus( nil )             event.target.isfocus = false         end     end     return true end 

i believe obvious touchhandler function ^^


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -