Why cann't I catch the mouse message? codes following

def mouseTask(task):

if base.mouseWatcherNode.hasMouse():
    mpos = base.mouseWatcherNode.getMouse()
    
    if mouseStatus is not False:
        print "YYYYYYYYY"
        pandaActor.setPos(mpos.getX(), 0, mpos.getY())

return Task.cont

global mouseStatus

def mouseButtonDown():
mouseStatus = True

def mouseButtonUp():
mouseStatus = False

mouseStatus = False
base.accept(“mouse1”, mouseButtonDown)
base.accept(“mouse1-up”, mouseButtonUp)


When I pressed the mouse leftbutton, mouseButonDown function worked,but mouseTask didn’t print YYYYYYY.

I researched this for about 4hours, but nothing found.
Help me

Move “global mouseStatus” line inside mouseButtonDown().

Still cann’t work.

Can you post the whole program source code ?

Remember to click the “Code” button to make sure the spacing as correctly shown after posting.