That’s the solution you gave me previously, and that’s what doesn’t work. I must be not clear what the problem is. When you click on a button, don’t let go of the button and move the cursor out of it’s frame, MouseWatcher.isOverRegion() in fact starts returning False.
Here’s an example:
from panda3d.core import *
import direct.directbase.DirectStart
from direct.gui.DirectGui import *
def mytask(task):
print base.mouseWatcherNode.isOverRegion()
return task.cont
taskMgr.add(mytask, 'mytask')
button = DirectButton(text = 'AAAA', suppressMouse = False)
scene = loader.loadModel('environment')
scene.reparentTo(render)
run()