def on_click(self, event):
        """
        Control moc with mouse clicks.
        """
        button = event["button"]
        if button == self.button_pause:
            if self.state == "STOP":
                self.py3.command_run("mocp --play")
            else:
                self.py3.command_run("mocp --toggle-pause")
        elif button == self.button_stop:
            self.py3.command_run("mocp --stop")
        elif button == self.button_next:
            self.py3.command_run("mocp --next")
        elif button == self.button_previous:
            self.py3.command_run("mocp --prev")
        else:
            self.py3.prevent_refresh()
def on_click ( self , event ) : button = event [ "button" ] if button == self . button_pause : if self . state == "STOP" : self . py3 . command_run ( "mocp --play" ) else : self . py3 . command_run ( "mocp --toggle-pause" ) elif button == self . button_stop : self . py3 . command_run ( "mocp --stop" ) elif button == self . button_next : self . py3 . command_run ( "mocp --next" ) elif button == self . button_previous : self . py3 . command_run ( "mocp --prev" ) else : self . py3 . prevent_refresh ( )
Control moc with mouse clicks.