title: How can I disable the return_bind_key in PySimpleGui?
body: <p>I need to disable the bind_return_key parameter to false after a question is answered incorrectly. The parameter is binded to the submit button under the key 'b1'. I used the .update() method and it worked around a week ago. It not longer works and I receive this error: &quot;TypeError: update() got an unexpected keyword argument 'bind_return_key'&quot;</p>
  <p>Is there a fix to this?</p>
  <p>Things I've tried:</p>
  <ul>
  <li>changed what is being updated from key 'b1' to 'Submit'</li>
  <li>opened a new project file to install the newest version which I think is 4.55.1</li>
  </ul>
  <pre><code>import PySimpleGUI as sg
  import json
  
  data = {
      &quot;question&quot;: [
          &quot;Q1. What is the equation for force&quot;,
          &quot;Q2. Define isotope&quot;,
          &quot;Q3. Define wavelength&quot;,
          &quot;Q4. Define modal dispersion&quot;
      ],
      &quot;answers&quot;: [
  
          &quot;f=ma&quot;,
          &quot;isotopes are atoms of the same element but with a different number of neutrons&quot;,
          &quot;the least distance between adjacent particles which are in phase&quot;,
          &quot;causes light travelling at different angles to arrive at different times&quot;
  
      ],
      &quot;automark&quot;: [
          [&quot;force=massxacceleration&quot;],
          [&quot;same number of protons&quot;, &quot;different number of neutrons&quot;, &quot;same element&quot;],
          [&quot;minimum distance between adjacent particles&quot;, &quot;particles which are in phase&quot;],
          [&quot;different angles&quot;, &quot;different times&quot;]
      ],
      &quot;markscheme&quot;: [
          [&quot;force=massxacceleration&quot;],
          [&quot;same number of protons&quot;, &quot;different number of neutrons&quot;, &quot;same element&quot;],
          [&quot;minimum distance between adjacent particles&quot;, &quot;particles which are in phase&quot;],
          [&quot;different angles&quot;, &quot;different times&quot;]
      ],
      &quot;mastery&quot;: [
          0,
          0,
          0,
          0
      ],
      &quot;incorrect&quot;: [
          0,
          0,
          0,
          0
      ]
  }
  
  
  def nextset(no, no2, do_not_stop, list1, list2):
      endlist = []  # number in the list represent question number
      while not do_not_stop:
          if no == 3:
              do_not_stop = True
  
          if list2[no] == list1[no2]:
              position = list1.index(list2[no])
              no += 1
              no2 = 0
              endlist.append(position)
              print(endlist)
  
          else:
              no2 += 1
      savetoexternal(endlist)
  
  
  def savetoexternal(endlist):
      with open(&quot;savefile.json&quot;, 'w') as f:  # creates external json file to be read from later
          json.dump(endlist, f, indent=2)
  
  
  # main program
  def listdata(list1):
      do_not_stop = False
      no = 0
      no2 = 0
      list2 = list1.copy()
      list2.sort(
          reverse=True)  # ordered question from highest to lowest while keeping original intact to preserve question number
      print(list1)
      print(list2)
      nextset(no, no2, do_not_stop, list1, list2)
  
  
  def main():
      # initialise the question, question number and answer
      question = data['question']
      answers = data['answers']
      automark = data['automark']
      markscheme = data['markscheme']
      mastery = data['mastery']
      incorrect = data['incorrect']
      q_no = 0
      max_q_no = 4
  
      sg.theme('DarkBlack')  # Adding colour
      # Stuff in side the window
  
      layout = [[sg.Text(&quot;                      &quot;), sg.Text(question[0], key='_Q1_', visible=True),
                 sg.Text(size=(60, 1), key='-OUTPUT-')],
                [sg.Text(&quot;correct answer:&quot;), sg.Text(size=(60, 1), key='-OUTPUTA-')],
                [sg.Text(&quot;automark allows:&quot;), sg.Text(size=(60, 1), key='-OUTPUTB-')],
                [sg.Text(&quot;your answer was:&quot;), sg.Text(size=(60, 1), key='-OUTPUTC-')],
                [sg.Text('Answer here:   '), sg.InputText(size=(60, 1), key='-INPUT-', do_not_clear=False)],
                [sg.Button('Submit', key='b1', bind_return_key=True), sg.Button('Cancel'), sg.Button('Skip')]]
  
      # Create the Window
      window = sg.Window('Rerevise', layout, size=(655, 565))
      # Event Loop to process &quot;events&quot; and get the &quot;values&quot; of the inputs
      while True:
          event, values = window.read()
          if event == sg.WIN_CLOSED or event == 'Cancel':  # if user closes window or clicks cancel
              break
  
          window['_Q1_'].Update(visible=False)
          window['-OUTPUT-'].update(question[q_no])
          select_not_mastered_question = True
          already_correct = False
  
          if all(x == 3 for x in mastery):
              print(&quot;all questions mastered&quot;)  # add to gui later
              list1 = []
              q_no = 0
              while q_no &lt; max_q_no:
                  list1.append(incorrect[q_no])
                  q_no += 1
              q_no = 0
              listdata(list1)
  
          if values['-INPUT-'].lower() == answers[q_no]:  # list index out of range occurs when all questions are complete, need to add completed screen by using else statement
              mastery[q_no] += 1  # need to add to gui
              print(mastery)
              q_no += 1
              if q_no == max_q_no:
                  q_no = 0
  
              while select_not_mastered_question:  # make sures the next question has not already been mastered
                  if mastery[q_no] == 3:
                      if q_no == max_q_no:
                          q_no = 0
                      q_no += 1
                  else:
                      select_not_mastered_question = False
  
              window['-OUTPUT-'].update(question[q_no])  # accepts the answer as correct and moves onto the next question
              window['-OUTPUTA-'].update('')
              window['-OUTPUTB-'].update('')
              window['-OUTPUTC-'].update('')
  
          if all(answer in values['-INPUT-'].lower() for answer in automark[q_no]):
              print(automark[q_no])
              mastery[q_no] += 1  # need to add to gui
              print(mastery)
              q_no += 1
              if q_no == max_q_no:
                  q_no = 0
  
              while select_not_mastered_question:  # make sures the next question has not already been mastered
                  if mastery[q_no] == 3:
                      if q_no == max_q_no:
                          q_no = 0
                      q_no += 1
                  else:
                      select_not_mastered_question = False
  
              window['-OUTPUT-'].update(question[q_no])  # accepts the answer as correct and moves onto the next question
              window['-OUTPUTA-'].update('')
              window['-OUTPUTB-'].update('')
              window['-OUTPUTC-'].update('')
  
              already_correct = True
  
          if any(answer in values['-INPUT-'].lower() for answer in automark[q_no]):  # shows the answer was correct but missing some key points
              if already_correct:
                  return
              else:
                  window['-OUTPUTA-'].update(answers[q_no])
                  window['-OUTPUTB-'].update(markscheme[q_no])
                  window['-OUTPUTC-'].update('partially correct')
                  window['-INPUT-'].update(disabled=True)
                  window['b1'].update(disabled=True)
                  window['b1'].update(bind_return_key=False)
  
          if event == 'Skip':
              q_no += 1
              if q_no == max_q_no:
                  q_no = 0
  
              while select_not_mastered_question:  # make sures the next question has not already been mastered
                  if mastery[q_no] == 3:
                      if q_no == max_q_no:
                          q_no = 0
                      q_no += 1
                  else:
                      select_not_mastered_question = False
  
              window['-OUTPUT-'].update(question[q_no])  # moves onto the next question
              window['-OUTPUTA-'].update('')
              window['-OUTPUTB-'].update('')
              window['-OUTPUTC-'].update('')
              window['-INPUT-'].update(disabled=False)
              window['b1'].update(disabled=False)
              window['b1'].update(bind_return_key=True)
  
          elif values['-INPUT-'] == '':
              print('answer was:', answers[q_no])  # for testing
              window['-OUTPUTA-'].update(
                  answers[q_no])  # shows that the answer is incorrect and displays the right answer
              window['-OUTPUTB-'].update(markscheme[q_no])
              window['-OUTPUTC-'].update('incorrect')
              window['-INPUT-'].update(disabled=True)
              window['b1'].update(disabled=True)
              window['b1'].update(bind_return_key=False)
              incorrect[q_no] += 1
              if mastery[q_no] == 0:
                  print(mastery)
              else:
                  mastery[q_no] -= 1
                  print(mastery)
  
      window.close()
  
  
  main()
  </code></pre>