I have searched and spent about literally two hours trying to solve this myself, but my efforts have failed me. My goal is to type a message in the text box, press tab to go to the email button then press enter to send the email.
Right now, pressing tab in the TEXT field creates word-processor-style indents, instead of moving to the next field.
The relevant part of the code is this:
from tkinter import *
#Build Window
def focus():
b.focus_set()
window = Tk()
window.title("What's Your Message?")
window.configure(background="black")
Label (window, text="Type Your Message:\n", bg="Black", fg="white", font="none 25 bold").pack(anchor=N)
e = Text(window, width=75, height=10)
e.pack()
e.focus_set()
e.bind("<Tab>", lambda e: focus())
b = Button(window, text="Send Email", takefocus=True, font="none 15 bold", width=10, command=lambda: click())
b.bind("<Return>", lambda e: click())
b.bind("<Tab>", lambda e: focus())
b.pack()
Can you tell me how to have the tab button no longer indent text in the text box, but instead move focus to the button? Right now, SHIFT + TAB works, but I'd like to understand how to get just hitting TAB to work.
Thank you for your time and help!