def directCreatingKeys(self, keyCode, modifier):
     if self.popUpup != None and self.popUpup.type == "input":
         char = self.getKey(keyCode)
         if char == '\r':
             if self.popUpup.button == 'title':
                 self.scoreTitle = self.popUpup.input
                 self.titleButton.text = self.scoreTitle
                 self.popUpup = None
             elif self.popUpup.button == "<--":
                 print(self.popUpup.input)
                 #SAVE NAME!
                 self.popUpup = None
                 self.init()
             elif self.popUpup.button == 'spec':
                 try:
                     welcome.correctFormTimeSig(self.popUpup.input)
                     self.timeSig = self.popUpup.input
                     self.popUpup = None
                 except:
                     question = "Please enter a valid time signature"
                     prev = "Please enter the time signature for your score (ex. 4/4)"
                     self.popUpup = PopUpBox((self.width/2, self.height/2), question, "ok", "spec", (prev, "input", "spec"))
         elif char == -1:
             self.popUpup.input = self.popUpup.input[:-1]
         elif char == None:
             self.popUpup.input += ""
         else:
             self.popUpup.input += char
     elif self.popUpup == None and self.canAdd:
         pass
 def directCreatingKeys(self, keyCode, modifier):
     if self.popUpup != None and self.popUpup.type == "input":
         char = self.getKey(keyCode)
         if char == "\r":
             if self.popUpup.button == "title":
                 self.scoreTitle = self.popUpup.input
                 self.titleButton.text = self.scoreTitle
                 self.popUpup = None
             elif self.popUpup.button == "<--":
                 print (self.popUpup.input)
                 # SAVE NAME!
                 self.popUpup = None
                 self.init()
             elif self.popUpup.button == "spec":
                 try:
                     welcome.correctFormTimeSig(self.popUpup.input)
                     self.timeSig = self.popUpup.input
                     self.popUpup = None
                 except:
                     question = "Please enter a valid time signature"
                     prev = "Please enter the time signature for your score (ex. 4/4)"
                     self.popUpup = PopUpBox(
                         (self.width / 2, self.height / 2), question, "ok", "spec", (prev, "input", "spec")
                     )
         elif char == -1:
             self.popUpup.input = self.popUpup.input[:-1]
         elif char == None:
             self.popUpup.input += ""
         else:
             self.popUpup.input += char
     elif self.popUpup == None and self.canAdd:
         pass
    def pressPopups(self, x, y):
        if self.popUpup.type == "Yes/No":
            if self.popUpup.button == "<--":
                if self.popUpup.whatPressed(x, y) == "Yes":
                    if self.scoreTitle == None:
                        question = "Enter a name for your score"
                        self.popUpup = PopUpBox((self.width / 2, self.height / 2), question, "input", "<--")
                    else:
                        # SAVE SOME SHIT
                        self.init()
                elif self.popUpup.whatPressed(x, y) == "No":
                    self.init()
            elif self.popUpup.button == "title":

                if self.popUpup.whatPressed(x, y) == "No":
                    self.popUpup = None
                elif self.popUpup.whatPressed(x, y) == "Yes":
                    question = "Would you like to change the name of your score?"
                    self.popUpup = PopUpBox((self.width / 2, self.height / 2), question, "input", "title")

        elif self.popUpup.type == "input":
            if self.popUpup.button == "<--":
                if self.popUpup.whatPressed(x, y) == "enter":
                    print (self.popUpup.input)
                    # SAVE NAME!
                    self.popUpup = None
                    self.init()
            elif self.popUpup.button == "title":
                if self.popUpup.whatPressed(x, y) == "enter":
                    self.scoreTitle = self.popUpup.input
                    self.titleButton.text = self.scoreTitle
                    self.popUpup = None
            elif self.popUpup.button == "spec":
                if self.popUpup.whatPressed(x, y) == "enter":
                    print ("hehe")
                    try:
                        welcome.correctFormTimeSig(self.popUpup.input)
                        self.timeSig = self.popUpup.input
                        self.popUpup = None
                    except:
                        question = "Please enter a valid time signature"
                        prev = "Please enter the time signature for your score (ex. 4/4)"
                        self.popUpup = PopUpBox(
                            (self.width / 2, self.height / 2), question, "ok", "spec", (prev, "input", "spec")
                        )
        elif self.popUpup.type == "ok":
            if self.popUpup.whatPressed(x, y) == "ok":
                print ("hehe")
                question, typ, button = self.popUpup.previous
                self.popUpup = PopUpBox((self.width / 2, self.height / 2), question, typ, button)
    def pressPopups(self, x, y):
        if self.popUpup.type == "Yes/No":
            if self.popUpup.button == '<--':
                if self.popUpup.whatPressed(x,y) == "Yes":
                    if self.scoreTitle == None:
                        question = "Enter a name for your score"
                        self.popUpup = PopUpBox((self.width/2, self.height/2), question, "input", "<--")
                    else:
                        #SAVE SOME SHIT
                        self.init()
                elif self.popUpup.whatPressed(x,y) == "No":
                    self.init()
            elif self.popUpup.button == "title":
                
                if self.popUpup.whatPressed(x,y) == "No":
                    self.popUpup = None
                elif self.popUpup.whatPressed(x,y) == "Yes":
                    question = "Would you like to change the name of your score?"
                    self.popUpup = PopUpBox((self.width/2, self.height/2), question, "input", "title")

        elif self.popUpup.type == "input":
            if self.popUpup.button == "<--":
                if self.popUpup.whatPressed(x,y) == "enter":
                    print(self.popUpup.input)
                    #SAVE NAME!
                    self.popUpup = None
                    self.init()
            elif self.popUpup.button == "title":
                if self.popUpup.whatPressed(x,y) == "enter":
                    self.scoreTitle = self.popUpup.input
                    self.titleButton.text = self.scoreTitle
                    self.popUpup = None
            elif self.popUpup.button == "spec":
                if self.popUpup.whatPressed(x,y) == "enter":
                    print("hehe")
                    try:
                        welcome.correctFormTimeSig(self.popUpup.input)
                        self.timeSig = self.popUpup.input
                        self.popUpup = None
                    except:
                        question = "Please enter a valid time signature"
                        prev = "Please enter the time signature for your score (ex. 4/4)"
                        self.popUpup = PopUpBox((self.width/2, self.height/2), question, "ok", "spec", (prev, "input", "spec"))
        elif self.popUpup.type == "ok":
            if self.popUpup.whatPressed(x,y) == "ok":
                print("hehe")
                question, typ, button = self.popUpup.previous
                self.popUpup = PopUpBox((self.width/2, self.height/2), question, typ, button)