就像 Corona 的 Brent Sorrentino 所说:你应该使用多点触控。
先看看这个http://docs.coronalabs.com/api/event/touch/id.html
已经可以自己动手了。这是我的实现:
system.activate( "multitouch" )
local object = display.newImage( "ball.png" )
object.numTouches = 0
function object:touch( event )
if event.phase == "began" then
display.getCurrentStage():setFocus( self, event.id )
self.numTouches = self.numTouches + 1
elseif event.phase == "cancelled" or event.phase == "ended" then
if self.numTouches <= 1 then
print( "This is a Left click" )
--call your onLeftClickFunction here
end
if self.numTouches == 2 then
print( "This is a Right click" )
--call your onRightClickFunction here
end
self.numTouches = 0
display.getCurrentStage():setFocus( nil )
end
return true
end
object:addEventListener( "touch", object )