I am writing a text editor in Python 3 with tkinter, and I'm trying to add an undo function, but in order to log the user's edits I need to log the edit when they type a letter. However, I don't want to log the typed letter if they have clicked out of the text widget. My question is this:
Can I detect whether or not the Text widget's cursor is in the widget? Is there an attribute on the text widget, or a bind I can put on the master window to detect if the cursor is in the text widget?