How to drag and tap on the same object using multitouch

Hello. I’m trying to solve a very peculiar problem.

I use a rectangle place over my whole screen space in order to move the player character (a spaceship) with a touch event.
Similarly, I use said rectangle in order to fire the ship’s laser with a tap event.

Everything is working properly, except for one thing: I can’t shoot with one finger while moving the ship with the other otherwise the ships starts bouncing all over the place on the screen. Is it possible? If so, how?

Here is the current code:

local function touchEvent(event) if(event.phase) then shipManage.drag(event, ship) else -- Event has no phase, so it's a tap shipManage.fireLaser(soundManage.fireLaserSound, ship) end return true end

shipManage.drag = function(event, ship) -- Touch phases: began, moved, ended, cancelled -- Need to check which phase the ship is in -- touch listener function if event.phase == "began" then ship.markX = ship.x -- store x location of object ship.markY = ship.y -- store y location of object beganTime = system.getTimer() elseif event.phase == "moved" then if(ship.markX) then if((event.x - event.xStart) + ship.markX \> 0 and (event.x - event.xStart) + ship.markX \< display.contentWidth) then ship.x = (event.x - event.xStart) + ship.markX end end if(ship.markY) then if((event.y - event.yStart) + ship.markY\>0 and (event.y - event.yStart) + ship.markY\<display.contentHeight) then ship.y = (event.y - event.yStart) + ship.markY end end elseif event.phase == "ended" then if(beganTime) then if(system.getTimer()-beganTime\<=300) then -- It's essentially a tap event, treat it as such shipManage.fireLaser(soundManage.fireLaserSound, ship) end end end end

Thanks in advance!