I might suggest using the “bind” method. Specifically, I suggest binding mouse-down and mouse-up events for the buttons in question. Have the callbacks that you assign to these events set a flag to “True” and “False” respectively, indicating that the button is pressed or un-pressed. And then, in a task, check the state of the flag, and run your logic if it is.
A simple example of using “bind”, if I’m not much mistaken in it:
def makeButton(self):
self.btn = DirectButton(text = "Button")
self.btn.bind(DGG.B1PRESS, self.buttonPressed)
def buttonPressed(self, mousePos):
print ("The button was pressed!")
This worked very well! Although, I did have to change a few other things around too, but hey that’s just a big part of programming in a nutshell. So, thank you for helping me, again. : )