I am trying to make a program that switches between my two screen in one screen in open cv using virtual button

if x < lmList1[8][0] < x + w and y < lmList1[8][1] < y + h:
            cv2.rectangle(img, button.pos, (x + w, y + h), (175, 0, 
             175), cv2.FILLED)
            cv2.putText(img, button.text, (x + 45, y + 65),
                        cv2.FONT_HERSHEY_PLAIN, 5, (255, 255, 255), 5)
            length, info, img = detector.findDistance(p1, p2,img)
            print("length=", length)
            if length < 40:
                if key[0]:
                     #faceAuth Logic
                if key[1]:
                    #qrAuth Logic

So i am trying to open different screen in opencv on virtual button press using gesture click and i am iteratting through list for click event but on key[0] which is my facerecognition starts